Total Pageviews

Friday, May 27, 2011

java script basic learning..


in javascript

if u want to check the empty value in text box?

u should have form name and text box name

select function name from form event like onsubmit= return function_name();

syntx

function function_name()
{
var txtbx=document.form_name.textbox_name;                   ///

if(txtbx.value=="" || txtbx.value==null )
{
 alert("text box is empty");
return false;
}

}

<form name="form_name"  onsubmit="return function_name()">
<input type="text" name="txtbx">
</form>

No comments:

Post a Comment