0

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 Answer 1

2

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

$(".comboboxClass").change(function() {
    var id = $(this).attr("id");
    $("form").submit(); 
}
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for that, but how do I connect this script to the combobox?
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.
Download the jQuery javascript file from jquery.com also take a look at docs.jquery.com/Tutorials:Getting_Started_with_jQuery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.