DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Hari Guest

    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

  2. #2
    Constance J. Petersen Guest

    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




  3. #3
    kapil Guest

    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



  4. #4
    Constance J. Petersen Guest

    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




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links