An HTML Form has 2 select lists (where users can select multiple options) along with 2 buttons - "Add" & "Remove". Initially, the 1st select list is completely vacant. When a user selects any option(s) from the 2nd select list & clicks the "Add" button, those options get added to the 1st select list. At the same time, the options which have been added to the 1st select list also get deleted from the 2nd select list. For e.g. (assuming that the 2nd select list has all the 12 months as its options) if a user selects Jan, Feb, Jul & Sep from the 2nd select list & clicks the "Add" button, then Jan, Feb, Jul & Sep get added to the 1st select list. Also these 4 records (Jan, Feb, Jul & Sep) get deleted from the 2nd select list. Similarly, if a user selects any option(s) from the 1st select list & then clicks the "Remove" button, then those options get deleted from the 1st select list & get added to the 2nd select list.
I want to have 2 more hidden fields in this Form so that the options added to the 1st select list from the 2nd list get listed in the 1st hidden field & the options added to the 2nd select list from the 1st select list get listed in the 2nd hidden field. For e.g. if a user chooses Jan, Feb, Jul & Sep from the 2nd select list & adds it to the 1st select list, the value of the 1st hidden field should be 1, 2, 7, 9 (assuming that the months' numbers are the values of the 12 options). Likewise if Jan & Jul are removed from the 1st select list & added to the 2nd select list, the value of the 2nd hidden field should be 1, 7. At the same time, the value of the 1st hidden field should change to 2, 9 (since 1 & 7 have been removed). How do I accomplish this?
Thanks,
Arpan
I want to have 2 more hidden fields in this Form so that the options added to the 1st select list from the 2nd list get listed in the 1st hidden field & the options added to the 2nd select list from the 1st select list get listed in the 2nd hidden field. For e.g. if a user chooses Jan, Feb, Jul & Sep from the 2nd select list & adds it to the 1st select list, the value of the 1st hidden field should be 1, 2, 7, 9 (assuming that the months' numbers are the values of the 12 options). Likewise if Jan & Jul are removed from the 1st select list & added to the 2nd select list, the value of the 2nd hidden field should be 1, 7. At the same time, the value of the 1st hidden field should change to 2, 9 (since 1 & 7 have been removed). How do I accomplish this?
Thanks,
Arpan