-
Clientside validation & stop submit!
Hi,
I want to validate some input values entered by the user before submitting
to the server. To submit the values, I am using HTML server control. OnClick
event, I am calling a client side function called 'ValidateValues()'. But
if there is any wrong value entered in any of the input fields, i dont want
to pass the information to the server. How can I stop the posting of the
data to the server? Could any one please help me.
Thanks,
Hari
-
Re: Clientside validation & stop submit!
Hi Hari,
"Hari" <v_hari@indya.com> wrote in message news:3cac3aba$1@10.1.10.29...
> I want to validate some input values entered by the user before submitting
> to the server. To submit the values, I am using HTML server control. OnClick
> event, I am calling a client side function called 'ValidateValues()'. But
> if there is any wrong value entered in any of the input fields, i dont want
> to pass the information to the server. How can I stop the posting of the
> data to the server? Could any one please help me.
Check out the new Web server validation controls. That's exactly what they are
intended to do, and the client-side code is built in.
--
Constance Petersen, DevX newsgroup section leader
SoftMedia Artisans, Inc.
http://www.smartisans.com
For useful, usable software and Web sites
Featured Web design: http://www.keweenawnow.com/
--
Please reply in the newsgroup so everyone can benefit
-
Re: Clientside validation & stop submit!
Hi,
I think if u use only html tages and client side javascript then u can avoid
to go server.
Regards,
kapil
"Hari" <v_hari@indya.com> wrote:
>
>Hi,
> I want to validate some input values entered by the user before submitting
>to the server. To submit the values, I am using HTML server control. OnClick
>event, I am calling a client side function called 'ValidateValues()'. But
>if there is any wrong value entered in any of the input fields, i dont want
>to pass the information to the server. How can I stop the posting of the
>data to the server? Could any one please help me.
>
>Thanks,
>Hari
-
Re: Clientside validation & stop submit!
Hi Kapil,
"kapil" <kapweb@msn.com> wrote in message news:3cad2a63$1@10.1.10.29...
> I think if u use only html tages and client side javascript then u can avoid
> to go server.
That's true. And there's nothing to stop you from writing your own client-side
scripts to validate html controls if you want to do that.
But, I like the new validation controls even better. ASP.NET can cut out round
trips by generating its own client-side scripts to compare what the visitor
enters (or doesn't enter) with the information you supply in the validation
controls' properties. If the visitor's browser supports Microsoft's version of
DHTML (Internet Explorer version 4.0 or higher), ASP.NET configures the page to
perform client-side validation as well as server-side validation.
Another plus: ASP.NET performs server-side validation even when client-side
validation has already been performed. The server-side validation checks guard
against potential client-side security breaches. So when the browser does not
support client-side validation (or JavaScript is disabled), the server-side
validation works alone to check the visitor's input.
--
Constance Petersen, DevX newsgroup section leader
SoftMedia Artisans, Inc.
http://www.smartisans.com
For useful, usable software and Web sites
Featured Web design: http://www.keweenawnow.com/
--
Please reply in the newsgroup so everyone can benefit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks