All pastes #1908 Raw Edit

javascript error

public text v1 · immutable
#1908 ·published 2004-11-04 21:31 UTC
rendered paste body
<!--
function Form1_Validator(theForm) 
{
	if (theForm.prefix.value == "")
	{
	alert("Please enter your Prefix");
	theForm.prefix.focus();
	return (false);
	}
	
	if (theForm.fname.value == "")
	{
	alert("Please enter your First Name");
	theForm.fname.focus();
	return (false);
	}
	
	if (theForm.lname.value == "")
	{
	alert("Please enter your Last Name");
	theForm.lname.focus();
	return (false);
	}
	
	if (theForm.degree.value == "")
	{
	alert("Please enter your Degree");
	theForm.degree.focus();
	return (false);
	}
	
	if (!theForm.licensed[0].checked || !theForm.licensed[1].checked)
	{
	alert("Please enter if you are licensed");
	return (false);
	}

	
	if (theForm.institution.value == "")
	{
	alert("Please enter your Institution");
	theForm.institution.focus();
	return (false);
	}
	
	if (theForm.address1.value == "")
	{
	alert("Please enter your Address");
	theForm.address1.focus();
	return (false);
	}
	
	if (theForm.city.value == "")
	{
	alert("Please enter your City");
	theForm.city.focus();
	return (false);
	}
	
	var state = theForm.state.value;
	if ((theForm.state.value == "") || !(state.length == 2))
	{
	alert("Please enter your State");
	theForm.state.focus();
	return (false);
	}
	
	var zip = theForm.zip.value;
	if ((theForm.zip.value == ""))
	{
	alert("Please enter your Zipcode");
	theForm.zip.focus();
	return (false);
	}
	else
	{
		if (isNaN(parseInt(zip)) || !(zip.length == 5)) {
		alert("Please enter a Valid Zipcode");
		theForm.zip.focus();
		return (false);
		}
	}
	
	
	
	if (theForm.email.value == "")
	{
	alert("Please enter your Email Address");
	theForm.email.focus();
	return (false);
	}
	
	if (theForm.email.value != "")
	{
		// test if valid email address, must have @ and .
		var checkEmail = "@.";
		var checkStr = theForm.email.value;
		var EmailValid = false;
		var EmailAt = false;
		var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
		{
		if (ch == checkEmail.charAt(j) && ch == "@")
		EmailAt = true;
		if (ch == checkEmail.charAt(j) && ch == ".")
		EmailPeriod = true;
			  if (EmailAt && EmailPeriod)
				break;
			  if (j == checkEmail.length)
				break;
			}
			// if both the @ and . were in the string
		if (EmailAt && EmailPeriod)
		{
				EmailValid = true
				break;
			}
		}
		if (!EmailValid)
		{
		alert("The Email field must contain an \"@\" and a \".\".");
		theForm.email.focus();
		return (false);
		}
		
	//alert("Please enter a Valid Email ");
	//theForm.Email.focus();
	//return (false);
	}

}
// -->
</script>

<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body onload='preloadImages();' leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0" bgcolor="#FAF2CF">
<table cellpadding="0" cellspacing="0" border="0">
   <tr valign=top>
   		<td><img src="GranChaik_topNav.gif" width="750" height="75" alt="" border="0" usemap="#topnav"></td>

   </tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="750" height="100%">
   <tr valign=top>
   <td background="leftNav/left_BG.jpg" style="background-repeat: no-repeat;" bgcolor="#CC9933" width="198">
<table cellpadding="0" cellspacing="0" border="0" width="198">
       <tr>
         <td valign="top"><img src="leftNav/GranChaik_leftTitle.gif" width="198" height="65" alt="" border="0"></td>
      </tr>
       <tr>

         <td valign="top"><a href="overview.php" onmouseover='changeImages("progOver","leftNav/overview_on.gif"); return true;' onmouseout='changeImages("progOver","leftNav/overview_off.gif"); return true;'><img src="leftNav/overview_off.gif" width=198 height=24 border=0 name="progOver"></a></td>
      </tr>
	  <tr>
	  	<td><img src="spacer.gif" width="1" height="1" alt="" border="0"></td>
	  </tr>
       <tr>
         <td valign="top"><a href="index.php" onmouseover='changeImages("progVid","leftNav/video_on.gif"); return true;' onmouseout='changeImages("progVid","leftNav/video_off.gif"); return true;'><img src="leftNav/video_off.gif" width=198 height=24 border=0 name="progVid"></a></td>
      </tr>
	  <tr>

	  	<td><img src="spacer.gif" width="1" height="1" alt="" border="0"></td>
	  </tr>
       <tr>
         <td valign="top"><img src="leftNav/cme_on.gif" width="198" height="24" border=0 name="cmeTest"></td>
      </tr>
	  <tr>
	  	<td><img src="spacer.gif" width="1" height="1" alt="" border="0"></td>
	  </tr>
       <tr>

         <td valign="top"><a href="evaluation.php" onmouseover='changeImages("prog_eval","leftNav/eval_on.gif"); return true;' onmouseout='changeImages("prog_eval","leftNav/eval_off.gif"); return true;'><img src="leftNav/eval_off.gif" width=198 height=24 border=0 name="prog_eval"></a></td>
      </tr>
	  <tr>
	  	<td><img src="spacer.gif" width="1" height="1" alt="" border="0"></td>
	  </tr>
       <tr>
         <td valign="top"><a href="resources.php" onmouseover='changeImages("resources","leftNav/resource_on.gif"); return true;' onmouseout='changeImages("resources","leftNav/resource_off.gif"); return true;'><img src="leftNav/resource_off.gif" width=198 height=24 border=0 name="resources"></a></td>
      </tr>
	  <tr>

	  	<td><img src="spacer.gif" width="1" height="1" alt="" border="0"></td>
	  </tr>
       <tr>
         <td valign="top"><a href="faculty.php" onmouseover='changeImages("faculty","leftNav/faculty_on.gif"); return true;' onmouseout='changeImages("faculty","leftNav/faculty_off.gif"); return true;'><img src="leftNav/faculty_off.gif" width=198 height=24 border=0 name="faculty"></a></td>
      </tr>
	  <tr>
	  	<td><img src="spacer.gif" width="1" height="465" alt="" border="0"></td>
	  </tr>
	  <tr>

	  	<td bgcolor="#cc9933"><img src="hyperCD_logo.jpg" width="190" height="90" alt="" border="0"></td>
	  </tr>
   </table>
   </td>
   <td rowspan="2"><img src="spacer.gif" width=21 height=1 border=0 alt=""></td>
   <td rowspan="2"><br><img src="GranChaik_title.gif" width="492" height="52" alt="" border="0"><br><!-- table containing main content -->
     <table width=502 cellpadding=0 cellspacing=0 border=0>
	   <tr>
	      <td><img src="spacer.gif" width="1" height="1" border=0 alt=""></td>

	      <td><img src="spacer.gif" width=500 height=1 border=0 alt=""></td>
	      <td><img src="spacer.gif" width="1" height="1" border=0 alt=""></td>
	   </tr>
	   <tr>
	      <td colspan=3 bgcolor="#5E121E"><img src="headers/cme_headers.gif" width="491" height="28" alt="CME Test" border="0"></td>
	   </tr>
	   <tr>
	      <td bgcolor="#5E121E"><img src="spacer.gif" width="1" height="1" border=0 alt=""></td>
	      <td class="content">		  <img src="spacer.gif" width="1" height="10" alt="" border="0"><br><div class="heading">Physician Accreditation</div>

		  This activity has been planned and implemented in accordance with the Essential Areas and policies of the Accreditation Council for Continuing Medical Education through the joint sponsorship of the Dannemiller Memorial Educational Foundation and Summit Grey.  The Dannemiller Memorial Educational Foundation is accredited by the ACCME to provide continuing medical education for physicians.<br><br>
<div class="heading">Designation of Credit</div>
The Dannemiller Memorial Educational Foundation designates this educational activity for a maximum of 1 category 1 credit toward the AMA Physician's Recognition Award.  Each physician should claim only those credits that he/she actually spent in the activity.<br><br>
Release Date: <strong>November 2004</strong><br><br>
Expiration Date: <strong>November 30, 2005</strong><br><br>
<div class="heading">Method of Physician Participation and Evaluation</div>
Participants must score at least 80% to receive category 1 CME credit. A certificate documenting your participation in this CME activity will be forwarded to your e-mail address upon successful completion of the test. <br><br>

<div class="heading">How to Obtain CME Credit</div>
Complete the CME test online and submit for instant scoring. Please complete all fields to ensure receipt of your CME certificate, which will be sent to the e-mail address you provide. Don't forget to complete the online evaluation form as well. <br><br>
<form name="formRegister" action="cme.php?do=register" method="post" onSubmit="return Form1_Validator(this)">
      <table border=0 cellpadding=0 align=left width="500">
       <tr>
        <td colspan=2>Please enter registrant information (* Required fields)</td>
       </tr>
       <tr>
        <td width="250"><strong>Prefix*</strong></td>

        <td width="250"><INPUT TYPE="TEXT" MAXLENGTH="5" NAME="prefix"></td>
       </tr>
       <tr>
        <td><strong>First Name*</strong></td>
        <td><INPUT TYPE="TEXT" MAXLENGTH="50" NAME="fname"></td>
       </tr>
       <tr>
        <td><strong>Middle Initial</strong></td>

        <td ><INPUT TYPE="TEXT" MAXLENGTH="1" NAME="initial"></td>
       </tr>
       <tr>
        <td><strong>Last Name*</strong></td>
        <td><INPUT TYPE="TEXT" MAXLENGTH="50" NAME="lname"></td>
       </tr>
       <tr>
        <td><strong>Suffix</strong></td>

        <td><INPUT TYPE="TEXT" MAXLENGTH="50" NAME="suffix"></td>
       </tr>
       <tr>
        <td><strong>Degree*</strong></td>
        <td><SELECT NAME="degree">
		<OPTION  VALUE="" SELECTED>---------------
		<OPTION  VALUE="MD">MD
		<OPTION  VALUE="DO">DO
		<OPTION  VALUE="other">other
		</SELECT></td>

       </tr>
	   <tr>
	   	<td><strong>Are you licensed in the United States?*</strong></td>
        <td><INPUT TYPE="CHECKBOX" NAME="licensed" value="yes">&nbsp;YES&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="licensed" value="no">&nbsp;NO</td>
	   </tr>
       <tr>