Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Need help!!! (See related posts)

I NEED A HELP....
I've Name, age and area fields in a form. I enter name and age leaving area.
After validating the form, the data entered in the form does not exist after clicking "ok button" in the alert msg box.
Also the focus is not set to the particular field.
I've used the below code;
if (emptyfield(formobj.area))
{
        alert("Please enter Area");
        formobj.area.focus();
}
function emptyfield(textobj)
{
        if (textobj.value.length ==0) return true;
        for (var i=0; i<textobj.value.length; i++)
        {
                var ch = textobj.value.charAt(i);
                if (ch !='' && ch !='\t') return false;
        }
        return true;
}

You need to create an account or log in to post comments to this site.


Related Posts