Form Verification Issue

Hi All,

I’m working on a client form that is located here which I have just taken over from another designer
[URL=“http://www.campusintercept.com/rep_application2.php”]www.campusintercept.com/rep_application2.php

My problem is that I want to turn off all of the required fields which seems controlled by an external javascript I have simply tried to delete the line calling the js script in the main page but when I do that the form will not send. If I place it back in the form will send but requires all fields to be mandatory.

Here is the start of the php form.

<form name="RepAppln" action="/rep_form/application2.php" method="POST" enctype="multipart/form-data">

here is the script it points to application2.php

<?php
extract($_POST); extract($_FILES);
$fd = fopen($photo[tmp_name], "r");
$contents = fread($fd, filesize($photo[tmp_name]));
$encoded1=chunk_split(base64_encode($contents));
fclose($fd);
$fd = fopen($resume[tmp_name], "r");
$contents = fread($fd, filesize($resume[tmp_name]));
$encoded2=chunk_split(base64_encode($contents));
fclose($fd);

$to = '<snip>';
$border = "--==================theboundary==";
$headers = "Mime-Version: 1.0\
";
$headers .= "Content-Type: multipart/mixed; boundary=\\"$border\\"\
";
$headers .= 'From: <snip>'."\\r\
";
$subject = 'Campus Rep Application from '.$firstname.' '.$lastname;
$body .= "--$border\
";
$body .= "Content-Type: text/plain; charset=us-ascii\
\
";
$body .= '***** DO NOT REPLY TO THIS MESSAGE *****'."\
";
$body .= 'THIS MESSAGE WAS GENERATED BY THE APPLICATION FORM AT'."\
";
$body .= 'CAMPUS INTERCEPT SITE. (To email the Applicant, click'."\
";
$body .= 'on their email address below.)'."\
";
$body .= "\
".'NAME: '.$firstname.' '.$lastname.' (';
if($gender=='M') {$body .='male)'."\
";} else {$body .='female)'."\
";}
$body .= 'EMAIL: '.$email."\
";
$body .= 'D.O.B: '.$month.' '.$date.', '.$year."\
\
";
if ($isstudent=='N') {
   $body .= 'STATUS: '.$firstname.' is NOT a student'."\
";}
else {
   $body .= 'STATUS: '.$firstname.' studies at '.$school."\
".'PROGRAM: ';
   if ($program=='other') {$body .= $otherprog."\
";} else {$body .= $program."\
";}
   }
$body .= "\
".'HOME ADDRESS: '."\
".$homeaddr.', '.$homecity.', '.$homeprov.'  '.$homepcode."\
";
if ($cellular=='') {$body .= 'PHONE: '.$homephone."\
\
";}
else {$body .= 'PHONE: '.$homephone.', CEL: '.$cellular."\
\
";}
if ($isstudent=='Y') {
   $body .= 'SCHOOL ADDRESS: '."\
".$schooladdr.', '.$schoolcity.', '.$schoolprov.'  '.$schoolpcode."\
";
   if ($schoolphone!='') {$body .= 'PHONE: '.$schoolphone."\
\
";}
   else {$body .= "\
\
";}
   }
$body .= 'APPLICATION-RELATED:'."\
";
if ($canwork=='Y') {$body .= 'Eligible to work in Canada.'."\
";}
else {$body .= 'NOT eligible to work in Canada'."\
";}
if ($isdriver=='Y') {$body .= 'Has driver\\'s license.'."\
";}
else {$body .= 'DOES NOT have driver\\'s license.'."\
";}
if ($hascar=='Y') {$body .= 'Has access to a vehicle.'."\
";}
else {$body .= 'DOES NOT have access to a vehicle.'."\
";}
if ($internet=='Y') {$body .= 'Has regular access to internet.'."\
";}
else {$body .= 'DOES NOT have regular access to internet.'."\
";}
if ($knowspromo=='Y') {$body .= 'Has worked in promotions.'."\
";}
else {$body .= 'DID NOT work in promotions.'."\
";}
if ($knowssales=='Y') {$body .= 'Has worked in sales.'."\
";}
else {$body .= 'DID NOT work in sales.'."\
";}
if ($knowsservice=='Y') {$body .= 'Has experience in customer service.'."\
\
";}
else {$body .= 'DOES NOT have experience in customer service.'."\
\
";}
$body .= 'HEARD ABOUT CAMPUS INTERCEPT: ';
if ($howheard=='radio') {$body .= 'on the radio.'."\
\
";}
else if ($howheard=='magazine') {$body .= 'in a magazine.'."\
\
";}
else if ($howheard=='online') {$body .= 'on the Net.'."\
\
";}
else if ($howheard=='friend') {$body .= 'through a friend.'."\
\
";}
else {$body .= $heardother.'.'."\
\
";}
$body .= 'DETAILS:'."\
".$details;
$body .= "\
--$border\
";
$body .= "Content-Type: ".$photo[type]."; name=\\"".$photo[name]."\\"\
";
$body .= "Content-Transfer-Encoding: base64\
";
$body .= "Content-Disposition: attachment; filename=\\"".$photo[name]."\\"\
";
$body .= "\
";
$body .= "$encoded1";
$body .= "\
--$border\
";
$body .= "Content-Type: ".$resume[type]."; name=\\"".$resume[name]."\\"\
";
$body .= "Content-Transfer-Encoding: base64\
";
$body .= "Content-Disposition: attachment; filename=\\"".$resume[name]."\\"\
";
$body .= "\
";
$body .= "$encoded2";
$body .= "--$border\
";
mail($to, $subject, $body, $headers);
?>
<html><head>
<style type="text/css"><!--
body {font-family:Verdana,Helvetica,Sans-serif;font-size:10pt}
table {font-family:Verdana,Helvetica,Sans-serif;font-size:10pt}
hr {color:#143a90;height:1px;margin:0px}
--></style>
</head>
<body>
<table width="550" cellspacing="0" cellpadding="2" style="border:1px solid #143a90">
<tr><td></b><b>Your form has been sent</b><br/><br/>Thank you for applying for a Campus
    Intercept Representative!<br/><br/></td></tr></table></body></html>

And the external javascript.

function verify() {
a = document.RepAppln;
while (a.firstname.value.substring(0,1) == ' ') a.firstname.value = a.firstname.value.substring(1);
while (a.firstname.value.substring(a.firstname.value.length-1, a.firstname.value.length) == ' ') a.firstname.value = a.firstname.value.substring(0,a.firstname.value.length-1);
if (a.firstname.value=='') {alert('Please enter the First Name');a.firstname.focus();return false;}
while (a.lastname.value.substring(0,1) == ' ') a.lastname.value = a.lastname.value.substring(1);
while (a.lastname.value.substring(a.lastname.value.length-1, a.lastname.value.length) == ' ') a.lastname.value = a.lastname.value.substring(0,a.lastname.value.length-1);
if (a.lastname.value=='') {alert('Please enter the Last Name');a.lastname.focus();return false;}
if (a.month.value=='' || a.date.value=='' || a.year.value=='') {alert('Please select full Date of Birth'); return false;}
while (a.email.value.substring(0,1) == ' ') a.email.value = a.email.value.substring(1);
while (a.email.value.substring(a.email.value.length-1, a.email.value.length) == ' ') a.email.value = a.email.value.substring(0,a.email.value.length-1);
if (a.email.value=='') {alert('Please enter the Email Address');a.email.focus();return false;}
if ( ! (/.+@.+\\..+$/i).test( a.email.value ) ) {
   alert('The Email Address is invalid. Please use\
the "myname@mydomain.com" format.');
   a.email.focus();return false; }
if (a.isstudent[0].checked==true) {
   if (a.school.value=='') {
      alert('Please select your School'); return false;}
   else {
      if (a.program.value=='') {
         alert('Please select your Program'); return false;}
      else {
         if (a.program.value=='other') {
            while (a.otherprog.value.substring(0,1) == ' ') a.otherprog.value = a.otherprog.value.substring(1);
			while (a.otherprog.value.substring(a.otherprog.value.length-1, a.otherprog.value.length) == ' ') a.otherprog.value = a.otherprog.value.substring(0,a.otherprog.value.length-1);
            if (a.otherprog.value=='') {
               alert('You selected "Other" as your\
Program. Please specify...');
               a.otherprog.focus();return false;}
            }
         }
      }
   }
while (a.homeaddr.value.substring(0,1) == ' ') a.homeaddr.value = a.homeaddr.value.substring(1);
while (a.homeaddr.value.substring(a.homeaddr.value.length-1, a.homeaddr.value.length) == ' ') a.homeaddr.value = a.homeaddr.value.substring(0,a.homeaddr.value.length-1);
if (a.homeaddr.value=='') {alert('Please enter the Home Address');a.homeaddr.focus();return false;}
while (a.homecity.value.substring(0,1) == ' ') a.homecity.value = a.homecity.value.substring(1);
while (a.homecity.value.substring(a.homecity.value.length-1, a.homecity.value.length) == ' ') a.homecity.value = a.homecity.value.substring(0,a.homecity.value.length-1);
if (a.homecity.value=='') {alert('Please enter the Home City');a.homecity.focus();return false;}
while (a.homepcode.value.substring(0,1) == ' ') a.homepcode.value = a.homepcode.value.substring(1);
while (a.homepcode.value.substring(a.homepcode.value.length-1, a.homepcode.value.length) == ' ') a.homepcode.value = a.homepcode.value.substring(0,a.homepcode.value.length-1);
if (a.homepcode.value=='') {alert('Please enter the Home Postal Code');homepcode.focus();return false;}
a.homepcode.value = a.homepcode.value.toUpperCase();
if ( !( /^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/.test(a.homepcode.value) ) ) {
   alert('The Home Postal Code is invalid.\
Please use the A1A 1A1 format.');
   a.homepcode.focus();return false; }
while (a.homephone.value.substring(0,1) == ' ') a.homephone.value = a.homephone.value.substring(1);
while (a.homephone.value.substring(a.homephone.value.length-1, a.homephone.value.length) == ' ') a.homephone.value = a.homephone.value.substring(0,a.homephone.value.length-1);
if (a.homephone.value=='') {alert('Please enter the\
Home Phone Number');a.homephone.focus();return false;}
if ( !( /^(\\(?\\d\\d\\d\\)?)?[ -]?\\d\\d\\d[ -]?\\d\\d\\d\\d$/.test(a.homephone.value) ) ) {
alert('The Home Phone Number is invalid.\
Please use the 111-111-1111 format.');
a.homephone.focus();return false; }
while (a.cellular.value.substring(0,1) == ' ') a.cellular.value = a.cellular.value.substring(1);
while (a.cellular.value.substring(a.cellular.value.length-1, a.cellular.value.length) == ' ') a.cellular.value = a.cellular.value.substring(0,a.cellular.value.length-1);
if (a.cellular.value!=='') {
   if ( !( /^(\\(?\\d\\d\\d\\)?)?[ -]?\\d\\d\\d[ -]?\\d\\d\\d\\d$/.test(a.cellular.value) ) ) {
      alert('The Cellular Number is invalid.\
Please use the 111-111-1111 format.');
      a.cellular.focus();return false; }
   }
if (a.isstudent[0].checked==true) {
   while (a.schooladdr.value.substring(0,1) == ' ') a.schooladdr.value = a.schooladdr.value.substring(1);
   while (a.schooladdr.value.substring(a.schooladdr.value.length-1, a.schooladdr.value.length) == ' ') a.schooladdr.value = a.schooladdr.value.substring(0,a.schooladdr.value.length-1);
   if (a.schooladdr.value=='') {alert('Please enter the School Address');a.schooladdr.focus();return false;}
   while (a.schoolcity.value.substring(0,1) == ' ') a.schoolcity.value = a.schoolcity.value.substring(1);
   while (a.schoolcity.value.substring(a.schoolcity.value.length-1, a.schoolcity.value.length) == ' ') a.schoolcity.value = a.schoolcity.value.substring(0,a.schoolcity.value.length-1);
   if (a.schoolcity.value=='') {alert('Please enter the School City');a.schoolcity.focus();return false;}
   while (a.schoolpcode.value.substring(0,1) == ' ') a.schoolpcode.value = a.schoolpcode.value.substring(1);
   while (a.schoolpcode.value.substring(a.schoolpcode.value.length-1, a.schoolpcode.value.length) == ' ') a.schoolpcode.value = a.schoolpcode.value.substring(0,a.schoolpcode.value.length-1);
   if (a.schoolpcode.value=='') {alert('Please enter the School Postal Code');a.schoolpcode.focus();return false;}
   a.schoolpcode.value = a.schoolpcode.value.toUpperCase();
   if ( !( /^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/.test(a.schoolpcode.value) ) ) {
      alert('The School Postal Code is invalid.\
Please use the A1A 1A1 format.');
      a.schoolpcode.focus();return false; }
   while (a.schoolphone.value.substring(0,1) == ' ') a.schoolphone.value = a.schoolphone.value.substring(1);
   while (a.schoolphone.value.substring(a.schoolphone.value.length-1, a.schoolphone.value.length) == ' ') a.schoolphone.value = a.schoolphone.value.substring(0,a.schoolphone.value.length-1);
   if (a.schoolphone.value!=='') {
      if ( !( /^(\\(?\\d\\d\\d\\)?)?[ -]?\\d\\d\\d[ -]?\\d\\d\\d\\d$/.test(a.schoolphone.value) ) ) {
         alert('The Shool Phone Number is invalid.\
Please use the 111-111-1111 format.');
         a.schoolphone.focus();return false; }
      }
   }
if (a.canwork[0].checked==false && a.canwork[1].checked==false) {
   alert('Please specify if you are\
eligible to work in Canada.');return false;}
if (a.isdriver[0].checked==false && a.isdriver[1].checked==false) {
   alert('Please specify if you have\
a valid driver\\'s license.');return false;}
if (a.hascar[0].checked==false && a.hascar[1].checked==false) {
   alert('Please specify if you have\
access to a vehicle.');return false;}
if (a.internet[0].checked==false && a.internet[1].checked==false) {
   alert('Please specify if you have\
regular access to internet.');return false;}
if (a.knowspromo[0].checked==false && a.knowspromo[1].checked==false) {
   alert('Please specify if you have\
worked in promotions.');return false;}
if (a.knowssales[0].checked==false && a.knowssales[1].checked==false) {
   alert('Please specify if you have\
worked in sales.');return false;}
if (a.knowsservice[0].checked==false && a.knowsservice[1].checked==false) {
   alert('Please specify if you have\
customer service experience.');return false;}
if (a.howheard[0].checked==false && a.howheard[1].checked==false && a.howheard[2].checked==false && a.howheard[3].checked==false && a.howheard[4].checked==false) {
   alert('Please specify how did\
you hear about us.');return false;}
else {
   if (a.howheard[4].checked==true && a.heardother.value=='') {
      alert('In how did you hear about us,\
you selected "Other." Please specify...');
      a.heardother.focus(); return false;}
   }
while (a.photo.value.substring(0,1) == ' ') a.photo.value = a.photo.value.substring(1);
while (a.photo.value.substring(a.photo.value.length-1, a.photo.value.length) == ' ') a.photo.value = a.photo.value.substring(0,a.photo.value.length-1);
if (a.photo.value=='') {alert('Please select the Picture File to upload');a.photo.focus();return false;}
while (a.resume.value.substring(0,1) == ' ') a.resume.value = a.resume.value.substring(1);
while (a.resume.value.substring(a.resume.value.length-1, a.resume.value.length) == ' ') a.resume.value = a.resume.value.substring(0,a.resume.value.length-1);
if (a.resume.value=='') {alert('Please select the Resume File to upload');a.resume.focus();return false;}
if (a.details.value=='') {alert('Please provide some details about yourself');a.details.focus();return false;}
//alert('Sve je u redu'); return false;
document.getElementById('whilesend').style.visibility='visible';
a.submit();
}

function prog_other() {
a = document.RepAppln;
if (a.program.value=='other') {
   document.getElementById('specify').style.color='#000000';
   a.otherprog.style.background='#ffffff';
   a.otherprog.disabled=false; a.otherprog.focus();
   }
else {
   document.getElementById('specify').style.color='#ffffff';
   a.otherprog.style.background='#eeeeee';
   a.otherprog.value=""; a.otherprog.disabled=true;
   }
}

function heard_other() {
a = document.RepAppln;
if (a.howheard[4].checked==true) {
   document.getElementById('otherspec').style.color='#000000';
   a.heardother.style.background='#ffffff';
   a.heardother.disabled=false; a.heardother.focus();
   }
else {
   document.getElementById('otherspec').style.color='#ffffff';
   a.heardother.style.background='#eeeeee';
   a.heardother.value=""; a.heardother.disabled=true;
   }
}

How can i get the required fields turned off?