User Confirms Form Submit

[Total: 0    Average: 0/5]

This shows how to confirm the submission of a form.

Head Code:

<script>
function question()
{
  var _ret = true;
  var msg = "  Are  you sure you want to continue?" + 
       " nYou will be permanetly changing this file." 
  if (!confirm(msg)) 
  {
    _ret = false;
    setTimeout("location.replace("http://www.js-examples.com/")",100); 
  }
  return (_ret);
} 
</script>

Body Code:

<Form action="http://www.js-examples.com/" method="post" Onsubmit="return question()"> 
     <input type="text" name="t1" value="some data">
 <Input Type="submit" Value="Submit" >
     </form> 

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *