Getting value of text box

When the form is submitted…


How do I get the value in the text box for the manufacturer?

<input list="manufacturers" id="Front_Manufacturer" name="Manufacturer" placeholder="Search">
<datalist id="manufacturers">
<option value="3Com">
<option value="8E6ER">
<option value="@Mailserver">
</datalist>

This doesnt work

 <input type="hidden" name="manufacturer" value="<script>document.write(document.getElementById('Front_Manufacturer').value);</script>">

You would instead takeover the submit event with a submit event handler.
That event handler can then make the adjustments that you need, then submit the form.

I have a question though. What you’re doing with the hidden form field, seems to just be duplicating what you already have for another form field. There doesn’t seem to be any benefit in having a visible Manufacturer form field along with an invisible manufacturer form field of the same value. But, there might be something about how the page works that I don’t understand.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.