Showing posts with label How to check null in java script. Show all posts
Showing posts with label How to check null in java script. Show all posts

Monday, August 31, 2009

Null check function in Javascript.

function checkNullField()

{

var field1 = document.formName.fieldName.value;

if(field1 == '')

{

alert("Field Name is empty");

return false;

}

else

{

return true;

}

}

Once you call this function in your jsp as return checkNullField(); then this function will return false if the field is empty else it will return true.