Web Hosting Talk







View Full Version : One Javascript Disables The OTher?? WHY!


azizny
06-01-2004, 01:03 PM
I have instaled a file for javascript validation for forms..

then when I came to installing a javascript for the menus, the validation does not work.. and no errors are shown?

both files are included in the header:

<script type="text/javascript" language="JavaScript1.2" src="functions/java_checker.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>

Peace,

azizny
06-01-2004, 01:41 PM
ok got this fixed..

one question i have in mind...

how do i do a sort-of border around the text box when there is a mistake

peace,

cenvo
06-01-2004, 02:42 PM
<script language="javascript">
function validator()
{
form1.textfield.className="txtInvalid"
return false;
}
</script>
<style>
.txtInvalid{
border: thin solid #FF0000;
}
</style>
<form name="form1" method="post" action="" onSubmit="return validator();">
<input name="textfield" type="text" >
<input type="submit" name="Submit" value="Submit">
</form>


Is this what you meant? I havent tested, if it works in browsers other than IE6.

Hope it helps!