Connecting Tech Pros Worldwide Help | Site Map

AJAX and validators

  #1  
Old November 21st, 2008, 04:35 PM
Alec MacLean
Guest
 
Posts: n/a
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
  #2  
Old November 21st, 2008, 04:45 PM
=?Utf-8?B?YnJ1Y2UgYmFya2Vy?=
Guest
 
Posts: n/a

re: AJAX and validators


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)


"Alec MacLean" wrote:
Quote:
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
  #3  
Old November 21st, 2008, 05:35 PM
Alec MacLean
Guest
 
Posts: n/a

re: AJAX and validators


Thanks Bruce - that's helped me a great deal.

Al

"bruce barker" <brucebarker@discussions.microsoft.comwrote in message
news:EBB66418-45AD-4786-890A-18459F88573F@microsoft.com...
Quote:
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)
>

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validators and JavaScript Nathan Sokalski answers 1 September 28th, 2008 12:15 AM
Asp .Net: Ajax validator compilation error ganesh22 answers 1 November 23rd, 2007 06:45 AM
Ajax ModalPopup panel just shows at bottom of the page mbruyns answers 1 October 1st, 2007 10:39 PM
ValidatorOnSubmit and Ajax calls rm1234@gmail.com answers 2 September 26th, 2007 04:15 PM