Submit.name : submit button : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » submit button »

 

Submit.name








The name property returns the name of the submit button.

This property is often accessed via the elements array of a Form object and used to return the name of the button.












<html>
    <head>
    <script language="JavaScript">
    <!--
    function getName(){
      alert("The name of this submit button is " + document.myForm.elements[1].name);
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="First Box" name="myText">
      <input type=SUBMIT value="Submit" name="mySubmit" onClick='getName()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» submit button