Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
67
rated 0 times [  71] [ 4]  / answers: 1 / hits: 21655  / 15 Years ago, fri, august 28, 2009, 12:00:00

Is there any way to do the following:



validateLogin();
return false;


But actually like this..



validateLogin();


And here is the function:



function validateLogin(){
if(hi=true){
return true;
}
else{
return false
}


I want to attach this function for the event of a form being submitted, so if HI is false - i want to return false; meaning it will stop for form from submitting.. i know return false; will do so i just need to know how i can get this return back to the parent function?



Thanks in advance!


More From » validation

 Answers
16

You can use it as follow:



return validateLogin();


however, as mmayo pointed out, don't forget about the return value:



event.returnValue = false;

[#98808] Tuesday, August 25, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emiliano

Total Points: 381
Total Questions: 109
Total Answers: 93

Location: Jersey
Member since Fri, Oct 1, 2021
3 Years ago
emiliano questions
;