jQuery - Set selected value of all dropdowns on page
- by Tgibson
Hello Frieds,
I have another jQuery question. For a user control with lots of database activity, I would like to use jQuery to set the selected values of all of the dropdowns to their "current" value. I want to do this to make the page appear to have finished the database call.
My jQuery skill is not the best, but I believe I need to use the pageLoad(). And since each dropdown is inside of a user control I can search for those dropdowns beginning with "usrControl"
$('select[id ^="usrControl"'].each(function(){
var selectedValue = $(this).val()
$(this).val(selectedValue)
});
Something like this is what I have in mind.
Thanks