How to Set a Value of Hidden Input From Values of Another Input Fields?

Clear all the values in the input fields by pressing the delete key and then make sure that you are working on two or more input fields at a time. In the control panel, select checkbox times two and change it to checkmark one. 

input hidden selected

on Jun 07, 2023
 <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; 
    }   

Add Comment

0

This will allow you to choose which input fields need to be hidden when there is a value from other inputs. It will show up as an option box.

Html answers related to "input type hidden"

View All Html queries

Html queries related to "input type hidden"

Browse Other Code Languages

CodeProZone