asp .net form...

Discussion in 'ASP .Net' started by mike, Jul 5, 2003.

  1. mike

    mike Guest

    Hello everyone,

    I have a server side asp .net form that has two peices of
    information that can be updated by one of two submit
    buttons. one submit button updates one database table
    with the top half of the form. On the bottom half of the
    form I have other infomation that can be instered or
    updated to another table in the database by a second
    submit button. Every thing was working fine until I added
    feild validators to both peices of information. So now my
    problem is that when I try to submit the top half of the
    information, it wants to validate the bottom half of the
    information at the same time. Is there any way to tell
    either a submit button to disregard some field validators
    or be able to tell the field validators not to fire when
    a particular submit button is fired?

    I thought about putting the bottom information in its own
    server side form, but apparently you can only have one
    server side form per page.

    Any help or suggestions would be greatly appreciated.

    Thanks,
    mike
     
    mike, Jul 5, 2003
    #1
    1. Advertising

  2. mike

    anastasia Guest

    Field Validation occurs on the client, as you know. When you set the
    Submit button's CausesValidation to TRUE in server side code, ASP will
    the write the following client onclick event in your submit button
    element:

    onclick="if (typeof(Page_ClientValidate) == 'function')
    Page_ClientValidate(); ".

    Page_ClientValidate is a function that is located in the
    WebUiValidation.js file (do a file search on this page).

    Get acquainted with the valiation code. You can step through it by
    debuggin your app on the client and open the "running documents"
    window...when your page loads it will display all the included
    documents on your page. Then, you can step through the validation
    process when you click "onsubmit".

    You will probably see that there are probably a number of ways you
    could manipulate this. Of course, don't change the webuivalidation.js
    file..that could be trouble ;-)

    You could do lots of things here...Maybe set CauseValidation to false
    on the Submit button and then MANUALLY add the onclick event code in
    your server side code (I haven't tried this, so I am not sure what
    sort of little problems could crop up - HOWEVER it can be done). You
    could, in your HTML, add some kind of property or divider in order to
    determine which controls to validation when. I don't know your code,
    so I can't advise how to do this..it could require a bit of work...

    Stacey

    You could possibly
     
    anastasia, Jul 5, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UWFqdXNzaQ==?=

    How to create a web form like MS access form using asp.net??

    =?Utf-8?B?UWFqdXNzaQ==?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    763
    =?Utf-8?B?UWFqdXNzaQ==?=
    Dec 27, 2004
  2. Li Zhang
    Replies:
    4
    Views:
    6,110
    softip
    Feb 27, 2009
  3. Mark
    Replies:
    2
    Views:
    6,124
  4. arvindmewara
    Replies:
    0
    Views:
    1,004
    arvindmewara
    Sep 8, 2007
  5. rob c
    Replies:
    4
    Views:
    347
    McKirahan
    Dec 30, 2005
Loading...

Share This Page