Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Client side validation in asp.net forms

Reply
Thread Tools

Client side validation in asp.net forms

 
 
Guest
Posts: n/a
 
      03-01-2004
Hi

Has anyone any experience using client side validation with asp.net forms.

Specifically I'd like to know...

1. How do you attach client side code web controls (a button), like a
JavaScript 'onclick' event for example?
2. Any issues anyone has experienced using client side validation with
asp.net forms?

Thanks in advance

Simon Ames


 
Reply With Quote
 
 
 
 
Krishnan
Guest
Posts: n/a
 
      03-01-2004
All validator controls run on the client side unless scripting in the client
browser is switched off. Hence using validator controls will be equivalent
to writing "Onclick" event code on the client side.


Krishnan

<(E-Mail Removed)> wrote in message
news:eYBjmJ3$(E-Mail Removed)...
> Hi
>
> Has anyone any experience using client side validation with asp.net forms.
>
> Specifically I'd like to know...
>
> 1. How do you attach client side code web controls (a button), like a
> JavaScript 'onclick' event for example?
> 2. Any issues anyone has experienced using client side validation with
> asp.net forms?
>
> Thanks in advance
>
> Simon Ames
>
>



 
Reply With Quote
 
 
 
 
Arvind P Rangan
Guest
Posts: n/a
 
      03-01-2004
Hi Simon,

Like you normally write a javascript and place it in regular place.
Only thing you have to do is.
for the button webcontrol add the following:
button.attribute.add("onClick","Javascript:return click();")
This has to be put in the page load so that this function is available when
the page is loaded.
i think this is what you want.
Anything else do reply.
ARvind.
<(E-Mail Removed)> wrote in message
news:eYBjmJ3$(E-Mail Removed)...
> Hi
>
> Has anyone any experience using client side validation with asp.net forms.
>
> Specifically I'd like to know...
>
> 1. How do you attach client side code web controls (a button), like a
> JavaScript 'onclick' event for example?
> 2. Any issues anyone has experienced using client side validation with
> asp.net forms?
>
> Thanks in advance
>
> Simon Ames
>
>



 
Reply With Quote
 
Jos
Guest
Posts: n/a
 
      03-01-2004
Krishnan wrote:
> All validator controls run on the client side unless scripting in the
> client browser is switched off. Hence using validator controls will
> be equivalent to writing "Onclick" event code on the client side.


Another condition is that the browser be IE.
ASP.NET client side validation doesn't work in Netscape.

--

Jos


 
Reply With Quote
 
Peter Blum
Guest
Posts: n/a
 
      03-01-2004
The button controls always use the client-side onclick event themselves for
running the client-side validation. You cannot just use
Button1.Atttributes.Add("onclick", "[your code]")
Instead, set Button1.CausesValidation = false to prevent it from generating
that code. Then add your code. If you want the client-side validation to
continue, the script is available by calling
Page.GetPostBackClientReference. For example:
Button1.Atttributes.Add("onclick", "[your code]" +
Page.GetPostBackClientReference(Button1, ""))

There are many issues with using client-side validation. In fact, there are
many issues with validation in general. I publish a replacement to
Microsoft's validations because there are so many limitations. Use this link
to see all the problems I found: http://www.peterblum.com/vam/valmain.aspx.
Even if you don't want my product ("Professional Validation And More" -
http://www.peterblum.com/vam/home.aspx), this list will help you plan your
development efforts better.

--- Peter Blum
www.PeterBlum.com
Email: http://www.velocityreviews.com/forums/(E-Mail Removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

<(E-Mail Removed)> wrote in message
news:eYBjmJ3$(E-Mail Removed)...
> Hi
>
> Has anyone any experience using client side validation with asp.net forms.
>
> Specifically I'd like to know...
>
> 1. How do you attach client side code web controls (a button), like a
> JavaScript 'onclick' event for example?
> 2. Any issues anyone has experienced using client side validation with
> asp.net forms?
>
> Thanks in advance
>
> Simon Ames
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
Rich client and ASP.NET forms running side-by-side?? JezB ASP .Net 3 02-04-2004 09:46 AM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt ASP .Net 14 01-30-2004 09:15 AM



Advertisments