Hi,
I have a form that utilizes validation as most do via javascript. This form worked totaly fine until I needed to add a dynamic div now the validation doesn't work. It does work for the first dropdown but nothing there after. I always get the error saying [form object] is null or not an object. I need help trying to figure out how to access the ojects in this form.
Now in my body I have a <form> and it's name is form1 and I also have another <form> around a drop down and it's name is change and it closes right after the drop down. I don't want to put all of the code here because it's lengthy but I'll put some of it here so that someone can help me figure out what's going on.
....on and on with validation now on to some of the body
[code=html]<body bgcolor="#00000 0" topmargin="0" leftmargin="0" onLoad="javascr ipt:hide();">
<table align="center" border="0" bgcolor="#DDE32 4" cellspacing="0" cellpadding="0" >
<tr>
<td bgcolor="#20249 C">
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" valign="top" height="31" bgcolor="#20249 C">
<p><img border="0" src="images/eCampuslgnew.jp g" alt="Keiser University eCampus Distance Education" width="693" height="85"><br >
<font face="Verdana" size="1" color="#FFFFFF" >Keiser University eCampus is the online division of Keiser University, Fort Lauderdale campus</font><b><font color="#FFFFFF" face="Verdana"> <br></font> <font color="#EEEAB9" face="Verdana"> Keiser University Division of Online Education Inquiry
Form</font><font color="#FFFFFF" face="Verdana"> <br></font></b> <font size="2" color="#EEEAB9" face="Verdana"> To have an Admissions Counselor contact you, please fill out the form below</font></p>
</td>
</tr>
</table>
<form name="form1" method="post" action="process _ecampus_inquir y.php">
<input type="hidden" name="type" value="KU Website">
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#2 0249C" width="691" id="table1">
<tr>
<td bgcolor="#20249 C" width="155"></td>
<td bgcolor="#20249 C"><span class="style19" >*indicates required field</span></td>
</tr>
<tr bgcolor="#DCDCD C">
<td valign="top" nowrap="nowrap" align="right" width="155"><sp an class="style21" ><font size="1">Progra m of Study*</font></span></td>
<td nowrap="nowrap" width="530">
<form name="change">< span class="style21" ><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><select id="program" tabindex="2" onChange="revea l(this.value);" name="program">
<option value="">Select A Program...</option>
<option value="">+ Master's Degrees</option>
<option value="MBA">&nb sp; -- Master 's in Business Administration</option>
<option value="">+ Bachelor Degrees</option>
<option value="ACCBA">& nbsp; &nbs p; -- Accountin g, BA</option>
<option value="BABA">&n bsp;   ; -- Busine ss Administration, BA - Management</option>
<option value="BABA-FIN"> &nbs p; -- Busine ss Administration, BA - Finance</option>
<option value="BABA-HRM"> &nbs p; -- Busine ss Administration, BA - Human Resources</option>
<option value="BABA-IBT"> &nbs p; -- Busine ss Administration, BA - Intl. Business</option>
<option value="BABA-MKT"> &nbs p; -- Busine ss Administration, BA - Marketing</option>
<option value="BACJ">&n bsp;   ; -- Crimin al Justice, BA</option>
<option value="BAHSA">& nbsp; &nbs p; -- Health Services Administration, BA</option>
<option value="BSHS">&n bsp;   ; -- Health Science, BS</option>
<option value="BAHS">&n bsp;   ; -- Homela nd Security, BA</option>
<option value="BSITM">& nbsp; &nbs p; -- Informati on Technology Management, BS</option>
<option value="BALS">&n bsp;   ; -- Legal Studies, BA</option>
<option value="MISBA">& nbsp; &nbs p; -- Managemen t Information Systems (MIS), BS</option>
<option value="BSN">&nb sp; -- Nursin g, RN to BSN</option>
<option value="" selected="selec ted">+ Associate Degrees</option>
<option value="ACCAS">& nbsp; &nbs p; -- Accountin g, AA</option>
<option value="CJAA">&n bsp;   ; -- Crimin al Justice, AA</option>
<option value="ITAS">&n bsp;   ; -- Informati on Technology, AS</option>
<option value="HSAAA">& nbsp; &nbs p; -- Health Services Administration, AA</option>
<option value="HS">&nbs p; & nbsp;-- Homela nd Security, AA</option>
<option value="MAAS">&n bsp;   ; -- Medica l Assisting, AS</option>
<option value="PLAA">&n bsp;   ; -- Parale gal Studies, AA</option>
</select></font></span></form>[/code]
Now this is the div in case this is need for whatever reason
[code=html]<div id="realtooltip " style="display: inline">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2 0249C" bgcolor="#DCDCD C" id="table2">
<tbody>
<tr>
<td align="middle" bgcolor="white" colspan="2">
<div align="center" class="style24" ><span class="style23" ><strong><fon t size="2">Must be a U.S. licensed RN to qualify for our nursing program.</font></strong><font size="2"><br>
<span class="style1"> Please answer the following if you are interested in our Bachelor of Science in Nursing program.</span><br>
<br>
Nursing Prerequisites</font></span></div>
</td>
</tr>
<tr>
<td></td>
<td nowrap="nowrap" width="100%"></td>
</tr>
<tr>
<td colspan="2">
<table width="350" border="0" id="table3">
<tbody>
<tr>
<td><span class="style21" ><font size="1">Do you possess a current, unrestricted license to practice as a registered nurse in at least one U.S. state, including the state in which a clinical will be completed?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="licensed" type="hidden" name="licensed" ></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table4">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio" onClick="form.l icensed.checked =false;form.lic ensed.value='ye s';" type="radio" value="yes" name="licensed" ></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio2" onClick="form.l icensed.checked =false;form.lic ensed.value='no ';" type="radio" value="no" name="licensed" ></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
<span class="style21" ><font size="1"> </font></span></td>
</tr>
<tr>
<td><span class="style21" ><font size="1">Are you a graduate of an associate degree program or a diploma nursing program?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="gpa" type="hidden" name="gpa"></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table5">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio3" onClick="form.g pa.value='yes'; form.gpa.checke d=false;" tabindex="30" type="radio" value="yes" name="gpa"></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio4" onClick="form.g pa.value='no';f orm.gpa.checked =false;" tabindex="31" type="radio" value="no" name="gpa"></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><span class="style21" ><font size="1">Are you a U.S. citizen or a national or permanent resident of the U.S.?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="uscitizen" type="hidden" name="uscitizen "></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table6">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input onClick="form.u scitizen.value= 'yes';form.usci tizen.checked=f alse;" tabindex="32" type="radio" value="yes" name="uscitizen "></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio5" onClick="form.u scitizen.value= 'no';form.uscit izen.checked=fa lse;" tabindex="33" type="radio" value="no" name="uscitizen "></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<layer></layer>
</div>
[/CODE]
I have a form that utilizes validation as most do via javascript. This form worked totaly fine until I needed to add a dynamic div now the validation doesn't work. It does work for the first dropdown but nothing there after. I always get the error saying [form object] is null or not an object. I need help trying to figure out how to access the ojects in this form.
Now in my body I have a <form> and it's name is form1 and I also have another <form> around a drop down and it's name is change and it closes right after the drop down. I don't want to put all of the code here because it's lengthy but I'll put some of it here so that someone can help me figure out what's going on.
Code:
<script>
<!--
function validate()
{
//check to see if the drop down was selected.
len = document.form1.program.length;
//alert(document.graderrors.school.length);
i = 0;
chosen = "none";
for (i = 0; i < len; i++)
{
if (document.form1.program[i].selected)
{
chosen = document.form1.program[i].value
//alert(document.graderrors.school[i].value);
}
}
if (chosen == "" || chosen==0 || chosen=="none")
{
alert('Please select your program of study');
return false;
}
//Check for errors
if(window.document.form1.firstname.value=='')
{
alert('Please fill out the First Name field');
window.document.form1.firstname.focus();
return false;
}
else if(window.document.form1.lastname.value=='')
{
alert('Please fill out the Last Name field.');
window.document.form1.lastname.focus();
return false;
}
[code=html]<body bgcolor="#00000 0" topmargin="0" leftmargin="0" onLoad="javascr ipt:hide();">
<table align="center" border="0" bgcolor="#DDE32 4" cellspacing="0" cellpadding="0" >
<tr>
<td bgcolor="#20249 C">
<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="center" valign="top" height="31" bgcolor="#20249 C">
<p><img border="0" src="images/eCampuslgnew.jp g" alt="Keiser University eCampus Distance Education" width="693" height="85"><br >
<font face="Verdana" size="1" color="#FFFFFF" >Keiser University eCampus is the online division of Keiser University, Fort Lauderdale campus</font><b><font color="#FFFFFF" face="Verdana"> <br></font> <font color="#EEEAB9" face="Verdana"> Keiser University Division of Online Education Inquiry
Form</font><font color="#FFFFFF" face="Verdana"> <br></font></b> <font size="2" color="#EEEAB9" face="Verdana"> To have an Admissions Counselor contact you, please fill out the form below</font></p>
</td>
</tr>
</table>
<form name="form1" method="post" action="process _ecampus_inquir y.php">
<input type="hidden" name="type" value="KU Website">
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#2 0249C" width="691" id="table1">
<tr>
<td bgcolor="#20249 C" width="155"></td>
<td bgcolor="#20249 C"><span class="style19" >*indicates required field</span></td>
</tr>
<tr bgcolor="#DCDCD C">
<td valign="top" nowrap="nowrap" align="right" width="155"><sp an class="style21" ><font size="1">Progra m of Study*</font></span></td>
<td nowrap="nowrap" width="530">
<form name="change">< span class="style21" ><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><select id="program" tabindex="2" onChange="revea l(this.value);" name="program">
<option value="">Select A Program...</option>
<option value="">+ Master's Degrees</option>
<option value="MBA">&nb sp; -- Master 's in Business Administration</option>
<option value="">+ Bachelor Degrees</option>
<option value="ACCBA">& nbsp; &nbs p; -- Accountin g, BA</option>
<option value="BABA">&n bsp;   ; -- Busine ss Administration, BA - Management</option>
<option value="BABA-FIN"> &nbs p; -- Busine ss Administration, BA - Finance</option>
<option value="BABA-HRM"> &nbs p; -- Busine ss Administration, BA - Human Resources</option>
<option value="BABA-IBT"> &nbs p; -- Busine ss Administration, BA - Intl. Business</option>
<option value="BABA-MKT"> &nbs p; -- Busine ss Administration, BA - Marketing</option>
<option value="BACJ">&n bsp;   ; -- Crimin al Justice, BA</option>
<option value="BAHSA">& nbsp; &nbs p; -- Health Services Administration, BA</option>
<option value="BSHS">&n bsp;   ; -- Health Science, BS</option>
<option value="BAHS">&n bsp;   ; -- Homela nd Security, BA</option>
<option value="BSITM">& nbsp; &nbs p; -- Informati on Technology Management, BS</option>
<option value="BALS">&n bsp;   ; -- Legal Studies, BA</option>
<option value="MISBA">& nbsp; &nbs p; -- Managemen t Information Systems (MIS), BS</option>
<option value="BSN">&nb sp; -- Nursin g, RN to BSN</option>
<option value="" selected="selec ted">+ Associate Degrees</option>
<option value="ACCAS">& nbsp; &nbs p; -- Accountin g, AA</option>
<option value="CJAA">&n bsp;   ; -- Crimin al Justice, AA</option>
<option value="ITAS">&n bsp;   ; -- Informati on Technology, AS</option>
<option value="HSAAA">& nbsp; &nbs p; -- Health Services Administration, AA</option>
<option value="HS">&nbs p; & nbsp;-- Homela nd Security, AA</option>
<option value="MAAS">&n bsp;   ; -- Medica l Assisting, AS</option>
<option value="PLAA">&n bsp;   ; -- Parale gal Studies, AA</option>
</select></font></span></form>[/code]
Now this is the div in case this is need for whatever reason
[code=html]<div id="realtooltip " style="display: inline">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#2 0249C" bgcolor="#DCDCD C" id="table2">
<tbody>
<tr>
<td align="middle" bgcolor="white" colspan="2">
<div align="center" class="style24" ><span class="style23" ><strong><fon t size="2">Must be a U.S. licensed RN to qualify for our nursing program.</font></strong><font size="2"><br>
<span class="style1"> Please answer the following if you are interested in our Bachelor of Science in Nursing program.</span><br>
<br>
Nursing Prerequisites</font></span></div>
</td>
</tr>
<tr>
<td></td>
<td nowrap="nowrap" width="100%"></td>
</tr>
<tr>
<td colspan="2">
<table width="350" border="0" id="table3">
<tbody>
<tr>
<td><span class="style21" ><font size="1">Do you possess a current, unrestricted license to practice as a registered nurse in at least one U.S. state, including the state in which a clinical will be completed?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="licensed" type="hidden" name="licensed" ></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table4">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio" onClick="form.l icensed.checked =false;form.lic ensed.value='ye s';" type="radio" value="yes" name="licensed" ></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio2" onClick="form.l icensed.checked =false;form.lic ensed.value='no ';" type="radio" value="no" name="licensed" ></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
<span class="style21" ><font size="1"> </font></span></td>
</tr>
<tr>
<td><span class="style21" ><font size="1">Are you a graduate of an associate degree program or a diploma nursing program?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="gpa" type="hidden" name="gpa"></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table5">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio3" onClick="form.g pa.value='yes'; form.gpa.checke d=false;" tabindex="30" type="radio" value="yes" name="gpa"></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio4" onClick="form.g pa.value='no';f orm.gpa.checked =false;" tabindex="31" type="radio" value="no" name="gpa"></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><span class="style21" ><font size="1">Are you a U.S. citizen or a national or permanent resident of the U.S.?</font></span></td>
<td valign="top" nowrap="nowrap" ><span class="style21" ><font size="1"> </font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="uscitizen" type="hidden" name="uscitizen "></font></span>
<table width="138" border="0" cellspacing="0" cellpadding="0" id="table6">
<tr>
<td width="47"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input onClick="form.u scitizen.value= 'yes';form.usci tizen.checked=f alse;" tabindex="32" type="radio" value="yes" name="uscitizen "></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">yes  ;</font></td>
<td width="27"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif"><input id="radio5" onClick="form.u scitizen.value= 'no';form.uscit izen.checked=fa lse;" tabindex="33" type="radio" value="no" name="uscitizen "></font></td>
<td width="32"><fon t size="1" face="Verdana, Arial, Helvetica, sans-serif">no</font></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<layer></layer>
</div>
[/CODE]
Comment