codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  onBlur on textbox server control  eshwar_gp at 08:56 on Wednesday, March 23, 2005
 

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

  Re: onBlur on textbox server control  sarvesh189 at 10:19 on Tuesday, May 31, 2005
 

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


  Re: onBlur on textbox server control  sarvesh189 at 10:41 on Tuesday, May 31, 2005
 

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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  What is the important of coding standard?
•  How to use two sorting methods for a product list?
•  www.Echeapjackets4moncler.com
•  What is the important of PHP include file?
•  What is JAVA socket?
•  What is the important of AJAX tools?
•  What is ASP.net life cycle?
•  Documentation Script (fixed)
•  Documentation Script


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012