Forum Moderators: open
Above code works fine in IE. But in NN/Opera, when press the GO button, it doesn't do anything or go anywhere. Any suggestion would be greatly appreciated.
Try this:
<FORM name="RegEmail" method="POST" action="EmailReg.asp">
<INPUT type="text" name="txtCustEmail" size="15" value="Enter E-mail Here" onClick="this.value = '';">
<img border="0" src="images/goBtn.jpg" onMouseOver="this.style.cursor = 'hand';" onClick="if (document.RegEmail.txtCustEmail.value == '') {alert('Please enter your E-mail address');}else{submit();}">
</FORM>
Works in IE6, Moz1.3 and Opera7, all on Windows ME.
document.all was part of Explorer's proprietary Document Object Model, so Explorer offers legacy support in version 6. However, the new standard DOM does not support it.
janehuangtw, I noticed an error in my code. The else-statement in the image tag should read
document.RegEmail.submit(); NN4 may give some problems with this, IIRC, or otherwise I think it doesn't support the onClick-event for images. Fortunately janehuangtw didn't mention NN4.