Hi,
Please can someone cast an experienced javascript eye over this code?
I've got this simple validation demo to work in Firefox by entering some stored content into two text fields and hitting enter it goes to the next demo page. I can't see what I need to amend to get it to work in IE. I've tried experimenting for hours and hours but I'm guessing it's to do with the 'onchange' event handler, but I'm no expert.
Any clues?
thanks...
(note - I can't use a visible submit button)
<code>
<script language="javascript">
<!--//
function pasuser(form) {
if (form.cmsorg.value=="120") {
if (form.cardnumber.value=="377064291003232") {
location="step2.html"
} else {
alert("Incorrect Card number entered. Please enter the correct number")
}
} else { alert("Incorrect CMS ORG number entered. Please enter the correct number")
}
}
//-->
</script>
</code>
<code>
<form name="login">
<input style="position:relative; top:162px; left:128px; width:40px; float:left; background-color:#000; color:#00FFCC; font-size:110%; border:0px solid #fff;" tabindex="1" name="cmsorg" type="text">
<input style="position:relative; top:161px; left:292px; width:200px; background-color:#000; color:#00FFCC; font-size:110%; border:0px solid #fff;" tabindex="2" name="cardnumber" type="text" onChange="pasuser(this.form)">
</form>
</code>
Please can someone cast an experienced javascript eye over this code?
I've got this simple validation demo to work in Firefox by entering some stored content into two text fields and hitting enter it goes to the next demo page. I can't see what I need to amend to get it to work in IE. I've tried experimenting for hours and hours but I'm guessing it's to do with the 'onchange' event handler, but I'm no expert.
Any clues?
thanks...
(note - I can't use a visible submit button)
<code>
<script language="javascript">
<!--//
function pasuser(form) {
if (form.cmsorg.value=="120") {
if (form.cardnumber.value=="377064291003232") {
location="step2.html"
} else {
alert("Incorrect Card number entered. Please enter the correct number")
}
} else { alert("Incorrect CMS ORG number entered. Please enter the correct number")
}
}
//-->
</script>
</code>
<code>
<form name="login">
<input style="position:relative; top:162px; left:128px; width:40px; float:left; background-color:#000; color:#00FFCC; font-size:110%; border:0px solid #fff;" tabindex="1" name="cmsorg" type="text">
<input style="position:relative; top:161px; left:292px; width:200px; background-color:#000; color:#00FFCC; font-size:110%; border:0px solid #fff;" tabindex="2" name="cardnumber" type="text" onChange="pasuser(this.form)">
</form>
</code>