|
Hi:
i am working with asp.net server controls. I am doing validations by validation controls. But, in one textbox i have to check value by onBlur() type fuction. When i focus out from that textbox, i need to show alert box like enter only numeric value, if i enter non-numeric value.
please somebody help me.
Thank you
eshwar_gp
|
|
|
hello eshwar_gp
on page_load() event in codebehind file
add this line
txtadd.Attributes.Add("onblur","return validate()");
and in .aspx page in body tag write this code
function validate()
{
----u can write here code in javascript for checking the numeric value.
alert('helelo');
}
regards
sarvesh
|
|
|
use this in client side javascript:
function validate(content)
{
if(isNaN(content)==true)
{
alert('Please enter numeric value');
return false;
}
else
return true;
}
and in codebehind this
txtadd.Attributes.Add("onblur","return validate(this.value)");
sarvesh
|
|
|
|
|
|
|
|