Retung from Function & FOCUS()

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top