Hi there,

I've got this code on my site for the script to check if certain fields in a form have been filled in, but would also like to add something to it whereby the script checks to see if the email and confemail (email confirmation) are the same.

Is there a way to add something to this code so that I don't have to play around with it? I'm totally unfamiliar with Java Scripts, as you can tell by the free script I'm using:


<script language="JavaScript">
<!--
function checkform ( form )
{
// see http://www.thesitewizard.com/archive/validation.shtml
// for an explanation of this script and how to use it on your
// own website

// ** START **
if (form.email.value == "") {
alert( "Please enter your email address." );
form.email.focus();
return false ;
}
// ** END **

// ** START **
if (form.confemail.value == "") {
alert( "Please confirm your email address." );
form.confemail.focus();
return false ;
}
// ** END **

// ** START **
if (form.fname.value == "") {
alert( "Please enter your first name." );
form.fname.focus();
return false ;
}
// ** END **

// ** START **
if (form.lname.value == "") {
alert( "Please enter your last name." );
form.lname.focus();
return false ;
}
// ** END **

// ** START **
if (form.subscription.value == "") {
alert( "Please select a subscription type." );
form.subscription.focus();
return false ;
}
// ** END **
return true ;
}
//-->
</script>