Reputation: 8882
I have a select element in part of my page, and a form all the way on the bottom. I'm trying to populate one of the form variables with the value of the select element like this:
<input type="hidden" value="valuefromselectelement..." name="foo" id="foo"/>
How can I do that? Presume the select element has the id currencySelect
.
Upvotes: 1
Views: 69
Reputation: 6047
you should handle the form's onsubmit
event
and put $('#foo').val($('#currencySelect').val());
Upvotes: 1