Use function to control <form> via onsubmit event handler - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form

Description

Use function to control <form> via onsubmit event handler

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <script type="text/javascript">
function ask () {/* w ww  .ja va2s.c o m*/
   return false;
}
    
      </script> 
   </head> 
   <body> 
      <form method="post" action="deletion.php" onsubmit="return ask()">
          Enter user ID to delete 
         <input type="text" name="uid"> 
         <br> 
         <input type="submit" value="Delete user"> 
      </form>  
   </body>
</html>

Related Tutorials