To support the legacy browsers, you still have to use document.all.txtCustEmail.value or something along those lines. In new browsers supporting the DOM use document.getElementById('txtCustEmail').value. That would mean you would have to define an id attribyte for your input. You will also need to implement a way to determine which kind of client you are using so that the appropriate script will get used.
That's all very true, but in this case one can easily replace the references to document.all by references to the form object or by using the this-thingy. That means it is not necessary to first detect DOM-support.
janehuangtw, I noticed an error in my code. The else-statement in the image tag should read
document.RegEmail.submit(); and not just submit();. That way non-IE browsers will also submit the form.
Ron, He is changing the value attribute of the input tag when an onclick event occurs on the img tag. In that case this.value refers to the img tag, so he needs to use employ some kind of browser detection to execute the right code for different browsers.
Hi Felix, What I meant to say is that form elements can be referred to without using document.all or document.getElementById(). All modern browsers can handle references like document.formName.inputFieldName
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.