Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

How we can validate Numeric Box using JavaScript in VS 2005

Author: Zunnair

In this article i will explain the in which we can validate our numeric box on client side of web page of vs 2005 using javaScript. because by using this method or technique we can by pass Post back o

The technique in which we can validate our numeric box on client side of web page of vs 2005 using javaScript we have to make a Client Side method & one Custom Validator and have to link the our client side method with Custom validator's Attribute. this technique is good enough because by using this method or technique we can by pass Post back of Web pages.

 

function Validation(source, args)

{

       var argValue = true;

       source.errormessage="";

       if(igedit_getById("<%=tQty.ClientID%>").getValue() == "0")

       {

            source.errormessage = "Please enter Quantity.";

            argValue = false;

           

       }

       if(igedit_getById("<%=tPrice.ClientID%>").getValue() == "0")

       {

            if(source.errormessage =="")

                source.errormessage = "Please enter Price.";

            else

                source.errormessage = source.errormessage +"
Please enter Price."
;

            argValue = false;

       }

 

       args.IsValid = argValue;

       return;

}

 

I hope this article is helpful for you in validating the control you can also validate any other control by using this method.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Send an E-Mail from Client to Server in ASP.net 2.0

Disclaimer - Privacy
© 2002-2017 DevASP.net