I have a form with some fields. One of them is a dropdown.
When the form is loaded, the dropdown list can be set to a value (depending of the value in the database).
The user can change the value in the dropdown or unset the value.
I put a reset button which set the selected index of the dropdown to -1 (the ‘please choose’ text appears).
But when i sent the form to the server after resetting the dropdown, the value of the dropdown list is still the previous value.
I try to write $(“#dropdown”).val(”) to set the value to null, but it does’nt work.
The only way i found is, when the selected index is equal to -1, to clear the dropdown just before sending the form.
Is it another way to set the selected value to nothing when the selected index is set to null (to -1) ?