Results 1 to 4 of 4

Thread: Required Field Validatior Question

  1. #1

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496

    Required Field Validatior Question

    This may be easy, but I must be overlooking the obvious.
    I have two command buttons on the web form, with 4 textbox's.
    When I click the first button, I submit the values of the first two textbox's. When I click the second button, I submit the values of the last two textbox's.

    Here's the problem. I'm using required field validators and I need each button to only validate its related two textbox's, where now I checks all controls on the form. Any ideas?

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    I don't use validators (is that bad?) .. But I validate them myself in VB code, and I have a label on the page (lblError)... and if something required is not filled out, i make the lblError visible and set its Text property to the error message.

  3. #3

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Using the required field validators, you have the option to do all of your validation on the client-side, thus avoiding the nasty roundtrip. I may just have to write my own javascript.

  4. #4
    Hyperactive Member
    Join Date
    Jan 2003
    Location
    Cape Cod, US
    Posts
    292
    You could always use a couple of custom validators.

    Associate the first with button A to validate boxes 1 & 2 and associate the other with button B to validate boxes 3 & 4.

    Bear in mind that the client-side validation isn't supported by all browsers...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width