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!)

About this user

Cheru

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Need help!!!

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;
}
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed