AJAX and validators

  • Thread starter Thread starter Alec MacLean
  • Start date Start date
A

Alec MacLean

Hi,

I have a page using AJAX. The page has three modal popups that work fine when I don't have field validators in place.

As soon as I put a validator in place, the popup "form" the validator is part of still works, but the click events (postback) of the other popups is stopped.

So, I have two data entry forms I want to validate, each within their own modal Popup panels.

The system detects the user type accessing the page and this determines which of the two entry forms to display, so only one will be used by a particular user at any time (e.g. normal user, or privileged user).

I also have a delete confirmation (OK or Cancel) modal popup, which is common to both user types.

When I place any validation on one of the entry forms, it stops the OK button postback click event of the delete confirmation from firing.

I also have to click the page twice to get navigation (e.g. date movement), which doesn't happen when the validations controls are removed.

I can probably resolve this by using server side validation, but I'd like to make the client app as responsive as possible.

I suspect that the Delete confirmation's OK button is causing the validators to trigger, but as these are not applicable (and in fact not even visible due to being in a different popup panel), the form appears to not be reacting.

Is there a trick to allowing separate buttons to postback even when validators are on the page but not applicable?

Thanks

Alec
 
popup panels are not seperate forms. they are part of the page. only their
display is controlled by javascript. a submit will cause all validators to
run whether they in a popup or not. you can use validation group names, and
give the validators in popup panel its own group. if you disable
causesvalidation on a button, it will not perform a client validation. use
this when needed.

-- bruce (sqlwork.com)
 
Back
Top