.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Client validation using JavaScript - A realtime scenario

Posted By:Gaurav Arora       Posted Date: April 28, 2009    Points: 10    Category: Javascript    URL: http://www.dotnetspark.com  
 

There are many ways to handle client side validation. But, I have some tricky ways described in the following snippet.

Step(s) :

1.      Choose any editor to write your code.

2.      It may be VS.net 2008 or prior(before Beta).

3.      Create a design page as per following line(s):

 

    horizontalalign="Center" visible="false">
 
 
  
   

  
   

  
 
  
   

      
       
        
                   font-bold="True" Text="Phone# ">
        

        
         
        

       

       
        
        
         
        

        
        
         
        
          a.m.
          p.m.
         

        
       

       

       
        
                   font-bold="True" Text="E-mail Address ">
        

        
                  
        

       

       
        
                   font-bold="True" Text="Mail ">
        

       

       
        
        
         
        

        
                  
        

       

       
        
        
         
        

        
                  
        

       

       
        
        
         
        

        
                  
        

        
         
        

        
                  
        

       

       
        
                   font-bold="True" Text="I do not wish to be contacted at this time ">          
        

       

      

     
    
   

1.      To handle client side validation, you can choose Validations too

2.      Here is some tricky, methods to handle the same.

3.      Add following javascript method(s):

Execution :

·                       Start your preferred VS.Net

·                       Load the file.

·                       Build/Run the project.

·                       Try to check validations by performing some nuinsense actions.

Note:

·                       Above is tested only at Visual Studio 2005

·                       Page can't be posted back

·                       Everything handled at client side.

 



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend