<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
for (i=o; i<invalidChars.length; i++)
{
if (testField.indexOf(invalidChars.charAt(i),0) > -1)
{return false;}
}
</script>
</head>
<body>
<form onSubmit="return invalidChars();">
<input type="text" name="testField">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Whats wrong with my code???
I get:
Error:
'return' statement outside of function
www.crmpicco.co.uk