Delete value from select menu option from saved record
Hello,
I think I'm missing something obvious.
In my
jsfiddle, when Radio Option 1 is clicked , the two drop down menu fields are required.
When Radio Option 2 is clicked, the two drop down menus are hidden and their values, if any were selected, are removed.
This works fine.
My problem occurs when I edit a record. If I had clicked Radio Option 1 and then two options from the select menus; if I go back and edit the record and choose Radio Option 2, while the select options are removed in the form, they are not deleted in the database.
Any ideas what I am missing?
I thought the code below removed the value from a select menu but it only saves the removed value from textfields.
- $('#21').val("");//state_2
I also tried the code blow but it did not work either.
- $('#country_2').prop( "selected", false );
Any help is appreciated, even if to let me know I'm missing something super obvious!
Thanks
Peter T