|
Make a registration page. Submit button with ImageButton
But the validation form uses self-written JS. Function CheckForm ()
This way I need to call CheckForm () that JS function after pressing ImageButton.
Add ImageButton.Attributes.Add ("onclick", "return CheckForm ();") to ImageButton
CheckForm () {
if (document.getElementById ("usrname"). value.length == 0) {
alert ("username");
return false;
}
else {
return true;
}
When I press the button, the user name has an alert effect when it is empty. But return false has no effect. The page is still submitted. Refreshed once. This is the effect of using IE. But using FF is effective. It is really strange I can't figure out what's going on. |
|