Basic Form Check

Fill out the form and then press Submit.  If you left any of them blank, the submittion will stop and the script will ask you to fill them out.  However, this form check does not check for the entries that is entered.  For example, you can enter "eicl#%$!54te" as your e-mail address, but the script will not detect it.

Your Name: 
Male
Female

E-Mail Address: 

 

Cut and paste the source code of the above script here (Read  How to Cut N Paste for help)

<!-----------------Cut---------------->
<HTML>
<HEAD>
<TITLE>Basic Form Check</TITLE>
<SCRIPT>
<!--
//    Script Editor:   Howard Chen
//    Browser Compatible for the script: IE 2.0 or Higher
//                                       Netscape 2.0 or Higher
//    This script is free as long as you keep its credits
function checkData()
{
var correct = true
if (document.Sample.name.value == "") {correct = false; alert("Please enter your name!")}
if (document.Sample.sex.checked == "") {correct = false; alert("Please check whether you are a male or a female.")}
if (document.Sample.email.value == "") {correct = false; alert("Please enter your e-mail address.")}
if (correct){alert("Thank you for taking your time to fill out this form."); return true}
return false
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<P><FORM onSubmit="return checkData()" NAME="Sample">Your Name:<INPUT NAME="name" size="25">
<BR><INPUT Type=radio NAME="sex" VALUE="M">Male<BR>
<INPUT Type=radio NAME="sex" VALUE="F">Female
<BR>E-Mail Address:<INPUT NAME="email" size=15>
<BR><INPUT TYPE=SUBMIT>
</BODY>
</HTML>
<!------------------End------------------->
IMPORTANT: The scripts provided in this page are free as long as you keep the credits in the code.  E-mail me or use Script Rebuild Service for additional help about Cut N Paste or to ask for a script that is just for you.
 
 


Post Your Script Home