Hi all,

I have a form which will work fine with Internet Explorer but will not work with Firefox. I think this may be to do with the JavaScript code included in it...

Form can be found at:
http://www.firststep.ie/life.php

Basically, the form collects some info and sends an email. The Jascript code enables/disables the second applicant fields based on the type of cover selected.

When you submit form from Firefox, you get..

Email Address must be entered
Contact Number must be entered

Code snippets:

-----------------------------------------
<script language="JavaScript">

<!--
function start() {
document.forms[0].person2sex.disabled = true;
document.forms[0].person2smoke.disabled = true;
document.forms[0].person2day.disabled = true;
document.forms[0].person2month.disabled = true;
document.forms[0].person2year.disabled = true;
}

function chgtx(sel_value) {
if(sel_value == "Single"){
document.forms[0].person2sex.disabled = true;
document.forms[0].person2smoke.disabled = true;
document.forms[0].person2day.disabled = true;
document.forms[0].person2month.disabled = true;
document.forms[0].person2year.disabled = true;
}
else {
document.forms[0].person2sex.disabled = false;
document.forms[0].person2smoke.disabled = false;
document.forms[0].person2day.disabled = false;
document.forms[0].person2month.disabled = false;
document.forms[0].person2year.disabled = false;
}
}

//-->

</script>
-------------------------------------------------

<body onLoad="chgtx('Single);

-------------------------------------------------

<form name="form1" method="post" action="mortprotform.php">

<select name="cover" size="1" id="cover" style="width: 150px;" onchange="chgtx(this.value)" >
<option value="Single" selected>Single
Cover</option>
<option value="Joint">Joint
Cover</option>
</select>

<tr>
<td valign="middle"><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Email
Address</font></td>
<td><input name="email" type="text" id="email" style="width: 150px;"></td>
</tr>
<tr>
<td colspan="2" valign="middle" height=4></td>
</tr>
<tr>
<td valign="middle"><font size="2" face="Geneva, Arial, Helvetica, sans-serif">Contact
Number </font></td>
<td><input name="phone" type="text" id="phone" style="width: 150px;"></td>
</tr>

-----------------------------------------------------

From the page that processes the form...

if ($email=='') {
$errMsg = $errMsg.'Email Address must be entered<BR>';
$err = TRUE;
}

-----------------------------------------------------

If anyone has any ideas.... it would be MUCH appreciated..