views:

111

answers:

1

We have a list of items on a ASP.Net MVC page, each row in the list has a combo box.

When the user selects a value in the combobox, we would like the form to be submitted. We also need to be able to read which line the user was on and which value was selected.

We have given each combobox a name that links it to the row on which it was on.

Thanks

Shiraz

+1  A: 

You'll need to do this with javascript, something like (jQuery)

$(".comboboxClass").change(function() {
    var id = $(this).attr("id");
    $("form").submit(); 
}
Jan Jongboom
Thanks for that, but how do I connect this script to the combobox?
Shiraz Bhaiji
This is a selector that will attach it to the combo boxes with the class "comboboxClass". Put this in a script area on the page with the appropriate jQuery script reference and you should be done.
RM
Download the jQuery javascript file from http://jquery.com/ also take a look at http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
RM