RobBroekhuis
Technical User
I'm new to JavaScript, and can't figure out what's causing my problem. I have the following piece of html document:
This generates an error in IE upon loading the page, indicating "expecting a (" on the line I marked above. The page then continues to load, and executes just fine. The function isn't called until the form is submitted, which works OK. What's my problem?
Rob
![[flowerface] [flowerface] [flowerface]](/data/assets/smilies/flowerface.gif)
Code:
<table width=100%><tr><td><h1>Welcome new user!</h1></td><td align=right><img src="hpslogosmall.gif"></td></tr></table> Joining the forum is easy. Just enter your username and password below,
along with your e-mail address. The username will be how you are known to
forum users. Unless you feel uncomfortable doing so, I suggest you use your
actual name. The information in the first section can be seen by all
forum users; the information in the second section is only to facilitate
your use of the forum, and cannot be viewed by anyone else.
<script language="JavaScript">
function pwdOK() {
var frm=window.document.NewUser;
var OK=true;
if (frm.username.value.length<4) {
alert("Username too short. Please enter one with at least 4 characters.");
frm.username.focus(); OK=false;} (*ERROR HERE*)
if (OK && !isNum(frm.donorcode.value) {
alert("Donorcode must be numeric (or left blank).");
frm.donorcode.select(); OK=false;}
if (OK && frm.pwd.value.length<4) {
alert("Please enter a password with at least 4 characters.");
frm.pwd.value=""; frm.pwd2.value=""; frm.pwd.focus();
OK=false;}
if (OK && frm.pwd.value!=frm.pwd2.value) {
alert("The two passwords you entered were not identical. Please try again");
frm.pwd.value=""; frm.pwd2.value=""; frm.pwd.focus();
OK=false;}
return OK;
}
</script>
Rob
![[flowerface] [flowerface] [flowerface]](/data/assets/smilies/flowerface.gif)