JavaScript issues
<p>My javascript is not working right.  It is simple pre-vailidation form and I can not get the script to work.  It is supposed to validate each field but I can not get it to validate past the first name.  I stripped out all of the other garbage so the code would not be confusing  Should be a copy paste to notepad.  Little help please </p>

<pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0         Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;


&lt;script language="JavaScript" type="text/javascript"&gt;    
&lt;!--    
function validateForm(theForm) {    
 var name = theForm.firstname.value;
 var name = theForm.lastname.value;     
 var email = theForm.email.value;    
 if (name == "") {    
   alert("Please fill in your First Name.");    
   theForm.firstname.focus();    
   return false;    
 }  
 if (name == "") {    
   alert("Please fill in your Last Name.");    
   theForm.lastname.focus();    
   return false;    
 }

 if (email == "") {    
   alert("Please fill in your email address.");    
   theForm.email.focus();    
   return false;    
 }    
 return true;    
}    
//--&gt; 

&lt;/script&gt;


if (!theForm.myCheckbox1.checked {    
 alert("Please check the honor box.");    
 return false;    
}


&lt;/head&gt;
&lt;body&gt;
&lt;/script&gt;    



&lt;fieldset&gt;
&lt;legend&gt;Fun in the Sun With JavaScript&lt;/legend&gt;  
&lt;ul&gt;  


&lt;form action="blah.cgi" method="post"    
     onSubmit="return validateForm(this);"&gt;    
First name: &lt;input type="text" name="firstname"&gt; &lt;font color="#FF0000" size="1"     face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/font&gt; &lt;br&gt;&lt;br&gt; 
Last name: &lt;input type="text" name="lastname"&gt; &lt;font color="#FF0000" size="1"     face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/font&gt;  &lt;br&gt;&lt;br&gt;
Email address: &lt;input type="text" name="email"&gt; &lt;font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/font&gt;  &lt;br&gt;&lt;br&gt;  
Phone Number: &lt;input type="text" name="phone"&gt;&lt;br&gt;&lt;br&gt;    
&lt;input type="submit" name="submit" value="Submit"&gt;    
&lt;/form&gt;   



&lt;input type="checkbox" name="myCheckbox" value="someValue"&gt;&lt;font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/font&gt; &lt;P&gt;By checking this Box you are confirming the data is accurate&lt;/p&gt;


&lt;p&gt;(* indicates a required field)&lt;/p&gt;





&lt;/body&gt;
&lt;/html&gt;
</code></pre>
