I have this snippet of code below. I want to pass the value of the select availabilityChoice as a second parameter to my updateAvailability javascript method.
I’ve tried everything (including an optionKey). How do you do this?
<label>Select Contact Availability:</label><g:select name="availabilityChoice" from="${['Inactive', 'Active']}" value=""/>
<g:actionSubmit type="button" value="Update Availability" onclick="updateAvailability('contactList', availabilityKey.value);"/>
I should add that contactList is a list of check boxes that were selected. So I need to pass that list of selected checkboxes, the value of the select box, and update those selections with the value in the select box.
Set an ID for
<select>by usingidattribute, and then you can refer to that element in javascript.