M
mtek
Hi,
I call a function with the following code:
<a href="javascript:formvalidation(this);">SAVE DATA</a>
Then, I validate the data:
if (emptyvalidation(thisform.Add_Data.CustName,"Customer Name is
empty")==false) {thisform.Add_Data.CustName.focus(); return false;};
The 'emptyvalidation' function is simple:
function emptyvalidation(entered, alertbox) {
with (entered) {
if (value==null || value=="" || value==" ")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
When it returns from the function, if the value is FALSE, then the
screen clears and the word 'false' is printed onto the screen. If I
put a document.write after the call to emptyvalidation, it prints what
I ask it to on the blank screen.
My question: Why is print the word FALSE?? I just need the form to
return focus to the text field I stated and that is it.....
Thanks!
John.
I call a function with the following code:
<a href="javascript:formvalidation(this);">SAVE DATA</a>
Then, I validate the data:
if (emptyvalidation(thisform.Add_Data.CustName,"Customer Name is
empty")==false) {thisform.Add_Data.CustName.focus(); return false;};
The 'emptyvalidation' function is simple:
function emptyvalidation(entered, alertbox) {
with (entered) {
if (value==null || value=="" || value==" ")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}
When it returns from the function, if the value is FALSE, then the
screen clears and the word 'false' is printed onto the screen. If I
put a document.write after the call to emptyvalidation, it prints what
I ask it to on the blank screen.
My question: Why is print the word FALSE?? I just need the form to
return focus to the text field I stated and that is it.....
Thanks!
John.