hidden input element code example

Example: input hidden selected

<form>
    <select id="dropdown" name="dropdown" onchange="changeHiddenInput(this)">
        <option value="j.hotmail.com">Jens</option>
        <option value="a.hotmail.com">Adam</option>
        <option value="d.homtail.com">Dan</option>
    </select>
    <input type="hidden" name="hiddenInput" id="hiddenInput" value="" />
 </form>

    function changeHiddenInput (objDropDown)
    {
        var objHidden = document.getElementById("hiddenInput");
        objHidden.value = objDropDown.value; 
    }

Tags:

Html Example