Hi everyone,
I need to insert the text of a selected text box into a hidden field, I'm not quite sure how to achieve that,
any help would be appriciated.
<form id="select">
<select name="select" id="select">
<option>NY, 10", £6.65</option>
<option>NY, 12", £8.95</option>
<option>NY, 16", £11.95</option>
<option>Chicago, 7", £3.45</option>
<option>Chicago, 10", £6.65</option>
<option>Chicago, 12", £8.95</option>
<option>Chicago, 16", £11.95</option>
<option>Chicago, Beast 24" x 18", £19.95</option>
</select>
</form>
<form id="add-pizza">
<input type="hidden" name="my-item-name" value="" />
</form>
I need to insert the text of the text box into the hidden field value="".
$(function()
{
var str="";
$("#select option:selected").each(function() {
str += $this.text() + "";
});
});
thanks