I've tried several things but I can't figure out why I'm recieving the following error: document.webform. FirstName.value is null or not an object
This is the following code.
<SCRIPT LANGUAGE="JavaScript">
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function checkFields() {
missinginfo = "";
if (document.webform.FirstName.value == "") {
missinginfo += "\n - FirstName";
}
if ((document.webform.LastName.value == "") ||
(document.form.from.value.indexOf('@') == -1) ||
(document.form.from.value.indexOf('.') == -1)) {
missinginfo += "\n - Last Name";
}
if ((document.webform.Address.value == "") ||
(document.form.website.value.indexOf("http://") == -1) ||
(document.form.website.value.indexOf(".") == -1)) {
missinginfo += "\n - Address";
}
if(document.webform.Email.value == "") {
missinginfo += "\n - Email";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
// End -->
</script>
</HEAD>
And the form code is
<form name ="webform" action = "tryHELP.php" method = post onSubmit="return checkFields();">
<p>
<input type="checkbox" name="join" value="checkbox">
Yes I would like to become a Total Victory Partner.<br>
<br>
I would like to contribute the following on a monthly basis<br>
(Please enter the amount in 20, 50, 100 format without the decimal)</p>
<p align="center">
<input type= Text Name= "Array[Amount]" size="10">
</p>
<p align="center"> First Name
<Input Type = Text Name = "Array[FirstName]" Size = 20>
<br>
Last Name
<Input Type = Text Name = "Array[LastName]" Size = 40>