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;
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; }