Hi Could you please tell me why my script is not running on IE6/IE7/safari. it works fine on localhost but when i put this file on a host it wont work. Here is my html code, works good on firefox
<body>
<SCRIPT TYPE=”text/javascript”>
function validateOnSubmit() {
var elem;
var errs=0;
if (!validateFName(document.forms.anthology.contFName, ‘inf_FName’)) errs += 1;
if(!validateMName(document.forms.anthology.contMName, ‘inf_MName’)) errs += 1;
if (errs>1) alert(‘There are fields which need correction before sending’);
if (errs==1) alert(‘There is a field which needs correction before sending’);
return (errs==0);
};
</SCRIPT>
<table class=”formtab” summary=”Demonstration form”>
<tr>
<td width=”80″ style=”width: 5em”><label for=”from”>Section Title</label></td>
<td width=”210″><input type=”text” name=”SectionTitle” id=”SectionTitle” size=”35″ maxlength=”50″
onchange=”validateSectionTitle(this, ‘inf_SectionTitle’, true);” /></td>
<td width=”142″ id=”inf_SectionTitle”>Required</td>
</tr>
</table>
<label><br />
</label>
</body>
function validateSectionTitle(valfield,
infofield) {
var stat = commonCheck (valfield, infofield,true);
if (stat != proceed) return stat;
msg (infofield, “warn”, “”);
return true;
}
function commonCheck(valfield, infofield, required)
{
if (!document.getElementById)
return true; var elem = document.getElementById(infofield);
if (!elem.firstChild) return true;
if (elem.firstChild.nodeType != node_text) return true;
if (emptyString.test(valfield.value)) {
if (required) {
msg (infofield, “error”, “ERROR: required”);
setfocus(valfield);
return false;
}
else {
msg (infofield, “warn”, “”);
return true;
}
}
return proceed;
}