JavaScript Reference/Event Handlers Reference/onSubmit

Материал из Web эксперт
Версия от 18:30, 25 мая 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.