JavaScript Reference/Event Handlers Reference/onSubmit — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 08:22, 26 мая 2010

"onSubmit" Example

    
<html>
<body>
<form name="form1" 
      method="post" 
      action="" 
      onsubmit="alert("The form is being submitted")">
   <input type="text" name="textfield">
   <input type="submit" value="Submit">
</form>
</body>
</html>



"onSubmit" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<form>                                                        |
+----------------+--------------------------------------------------------------+



"onSubmit" Properties

+----------------+--------------------------------------------------------------+
| Properties     |altKey                          altLeft                       |
|                |ctrlKey                         ctrlLeft                      |
|                |returnValue                     shiftLeft                     |
|                |srcElement                      type                          |
+----------------+--------------------------------------------------------------+



"onSubmit" Syntax and Note

Note:
    
This event fires when the user submits a form or clicking a Submit button.
This event is in response to the form.submit() method.
Use this action to validate data on the client side.