Professional Web Applications Themes

asp .net form... - ASP.NET General

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, ...

  1. #1

    Default asp .net form...

    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 Guest

  2. #2

    Default Re: asp .net form...

    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 doents"
    window...when your page loads it will display all the included
    doents 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 Guest

Similar Threads

  1. Replies: 0
    Last Post: May 28th, 10:04 AM
  2. file upload form enctype="multipart/form-data
    By kbuska525 in forum Macromedia ColdFusion
    Replies: 2
    Last Post: June 27th, 04:52 AM
  3. Replies: 1
    Last Post: February 22nd, 12:29 AM
  4. Replies: 0
    Last Post: September 27th, 01:46 PM
  5. Replies: 0
    Last Post: September 27th, 03:23 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139