Submit : submit button « Form « JavaScript Tutorial

Home
JavaScript Tutorial
1.Language Basics
2.Operators
3.Statement
4.Development
5.Number Data Type
6.String
7.Function
8.Global
9.Math
10.Form
11.Array
12.Date
13.Dialogs
14.Document
15.Event
16.Location
17.Navigator
18.Screen
19.Window
20.History
21.HTML Tags
22.Style
23.DOM Node
24.Drag Drop
25.Object Oriented
26.Regular Expressions
27.XML
28.GUI Components
29.Dojo toolkit
30.jQuery
31.Animation
32.MS JScript
JavaScript Tutorial » Form » submit button 
10.26.1.Submit

Instances are created by the browser when it encounters an HTML tag with the TYPE attribute set to SUBMIT.

In the JavaScript object hierarchy, the Submit object is located at window.document.Form.Submit.

Event Handlers/Methods/PropertiesDescription
onBlurCalled when the submit button loses focus.
onClickCalled when the submit button is clicked.
onFocusCalled when the submit button receives the focus.
blur()Removes focus from the submit button.
click()Simulates a mouse click on the submit button.
focus()Gives the focus to the submit button.
handleEvent()Invokes the handler for the event specified and was added in JavaScript 1.2.
formReturns the entire form the submit button is in.
nameReturns the name of the submit button specified by the NAME attribute.
typeReturns the type of this submit button specified by the TYPE attribute. This property always returns submit.
valueReturns the value of this submit button specified by the VALUE attribute.


<html>
    <head>
    <script language="JavaScript">
    <!--
    function openWin(){
      var myInstance = document.myForm.mySubmit;
      var myWin = open("""","width=450,height=200");

      myWin.document.write("The name is: " + myInstance.name + "<br>");
      myWin.document.write("The type is: " + myInstance.type + "<br>");
  
      myWin.document.write(myInstance.form.mySubmit.value);
      myWin.document.close();
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="Hello, World!" name="myText">
    <input type=SUBMIT value="Click to Submit" name="mySubmit"
             onClick="openWin()">
    </form>
    </body>
    </html>
10.26.submit button
10.26.1.Submit
10.26.2.Submit.blur()
10.26.3.Submit.click()
10.26.4.Submit.focus()
10.26.5.Submit.form
10.26.6.Submit.handleEvent()
10.26.7.Submit.name
10.26.8.Submit.onBlur
10.26.9.Submit.onClick
10.26.10.Submit.onFocus
10.26.11.Submit.type
10.26.12.Submit.value
10.26.13.Return false in form button click event
10.26.14.Using Image as the submit button
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.