BFreshour
Programmer
- Mar 20, 2002
- 84
If I'm testing the value of my form with the following javascript, it pops up messages for each field that has no data. I would like it to exit the function IF the value is false which would only allow a max of one messagebox. Make sense?
Code:
function validate() {
LCv=login.ClientID.value;
if (LCv=='') {
alert('You must select your company!');
event.returnValue=false;
}
LUv=login.Username.value;
if (LUv=='') {
alert('You must enter a username!');
event.returnValue=false;
}
LPv=login.Password.value;
if (LPv=='') {
alert('You must enter a password!');
event.returnValue=false;
}
}