ok I have error checking as listed below:I want to add to it as outlined below – it should be very easy but for some reason when I add the error it does not work – I have tried a multitude of variations. Please help – I believe I have explained it precisely but let me know if you need additional info.
Thanks,:eek:
</SCRIPT>
<FORM ACTION=”/ekeck/new-account/indexhld.phtml” METHOD=”POST” NAME=”SignupForm” ONSUBMIT=”return CheckFields();”>
<SCRIPT LANGUAGE=”JavaScript”>
function CheckFields() {
var Errors = “”;
Errors += document.SignupForm.FirstName.value == “” ? “You did not enter the first name.n” : “”;
Errors += document.SignupForm.LastName.value == “” ? “You did not enter the last name.n” : “”;
Errors += document.SignupForm.JobTitleID.value == “” ? “You did not select a job title.n” : “”;
Errors += document.SignupForm.DepartmentID.value == “” ? “You did not select a department.n” : “”;
if (Errors != “”) {
alert(Errors);
return false;
} else {
return true;
}
}
</SCRIPT>
elsewhere in the program I have the following array defined with an identifying number that is brought back into the program to update a database when something is checked:
<TR>
<TD COLSPAN=”2″ ALIGN=”CENTER”>
<BR><B>Access Modules</B><BR>
<INPUT TYPE=”CHECKBOX” NAME=”Access[1]”>PatientCare</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[2]”>OrderEntry</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[3]”>Department Desc 1</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[4]”>Kodak PACS</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[8]”>OmniCell</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[6]”>Some View</B>
<INPUT TYPE=”CHECKBOX” NAME=”Access[7]”>Another Dept</B>
</TD>
</TR>
I want to be able to add another error check to the checkfields() function above that if Access[8] is checked than they must also select Staff
Type which is defined under the array as a drop down:
<TR>
<TD ALIGN=”CENTER” COLSPAN=”5″>
<BR> <B> If OmniCell Please Select One: </B> <BR>
</TD>
</TR>
<TR>
<TD ALIGN=”CENTER” COLSPAN=”2″>
<SELECT NAME=”StaffType”>
<OPTION VALUE= ” “>Select Staff Type</OPTION>
<OPTION VALUE=”Staff”>Staff</OPTION>
<OPTION VALUE=”Coordinator/Supervisor”>Coordinator/Supervisor</OPTION>
</SELECT>
</TD>
</TR>