onsubmit action : onSubmit « Event onMethod « JavaScript DHTML






onsubmit action

  


<html>
<head>
  
  <script type="text/javascript">
     function confirmAction() {
       return confirm("Do you really want to do this?")
     }
  </script>
</head>
<body>
<form action="" onsubmit="return confirmAction()" method="post">
    <textarea name="comments" rows="6" cols="46"></textarea>
    <input type="submit" value="Submit" />
</form>
</body>
</html>

   
    
  








Related examples in the same category

1.'onSubmit' Example
2.Validate form in onsumbit function