Again, this is just a quick note about how to select an option with jQuery and remove the selected attribute.
$("#id-select :selected").removeAttr("selected");
$('#id-select').val('[value you need to select]');
As you can see, it is not enough just to select a new value using .val() because the selected attribute will stay on the form item and when you submit the form, the old value will be used.
Comments
Thanks. Simple and Precise
Simple and Precise
Thanks a lot
Post new comment