validating form getting sticky

Results 1 to 3 of 3

Thread: validating form getting sticky

  1. #1
    Join Date
    Dec 1969

    Default validating form getting sticky

    I've got my webform and it has a few search fields at the top. So, a user can come and search for an event in their area. I have a requiredfieldvalidator on the city text box. I also have more fields lower in my page so a user can add an event for their area. I have requiredfieldvalidators on some of those fields. The problem comes when I try to submit either the search or adding an event. If I'm adding an event, the requiredfieldvalidator for the searching higher in the page executes and won't submit the form. If I try the search, then the validation for the adding an event fields lower in the page executes and it won't let me submit. In traditional asp, I could just put these in 2 separate forms and all was dandy, but I know I can't do that with .net. So, what do I do to make sure that the city validator only fires when someone is running a search and not when they're trying to add an event? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Use the enabled property

    validation controls have an enabled property that you can set to "false" for the controls you don't want firing.

  3. #3
    Join Date
    Dec 1969

    Default RE: Use the enabled property - isn't there a

    Switching the enabled properties on and off all the time feels like a hack. There must be a way to bind validation controls to certain buttons... but I have found no such way. Anyone else have any insight here?

Posting Permissions

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