Return the name of the form that contains dropdown list (combobox) : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Return the name of the form that contains dropdown list (combobox)




<html>
<head>
<script type="text/javascript">
function formAction(){
    var x=document.getElementById("mySelect")
    alert(x.form.name)
}
</script>
</head>

<body>
<form name="myForm">
    <select id="mySelect">
        <option>Apple</option>
        <option>Banana</option>
        <option>Orange</option>
    </select>
    <input type="button" onclick="formAction()" value="Show name of the form">
</form>
</body>

</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Option Select ComboBox