Simple Javascript Form Validation

Bookmark and Share

11-06-2007 20:49:32


The Javascript required to show a confirmation popup before a form is submitted allowing the user to cancel the action.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<script type="text/javascript">
function check_delete()
valid = confirm("The item you picked will be permantly deleted from the database. Are you sure?")
return valid;
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<form name="contact_form" method="post" action="" onsubmit="return check_delete();">

<h1>Please Enter Your Name</h1>

<p>Your Name: <input type="text" name="contact_name"></p>
<p><input type="submit" name="send" value="Send Details"></p>



javascript  form  validation  delete  check  confirm 

Bookmark and Share


Enter you login details below to sign in to the site.

If you do not have a login you will need to register.

User Name