By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,153 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,153 IT Pros & Developers. It's quick & easy.

AJAX modal popup displays when it shouldn't

P: n/a
I have a situation in which I need to check for data in either of two fields
and display an alert if neither field contains data or if both fields contain
data when the user clicks on a View button; these two fields are for Member
Number and for Social Security Number. I have written a Javascript function
to handle that situation. A new condition was thrown at me yesterday in
which I need to display a modal popup only if a Social Security Number is
entered so the user can select from either of two systems containing the
data. I have the modal popup constructed, but it displays when it shouldn't.
For instance, taking the case of both fields being empty or both fields
containing data: on clicking the View button, an alert is displayed (via the
Javascript function) and dismissed by clicking on its OK button, but then the
modal popup gets displayed. In another case, the modal popup gets displayed
if the user enters a Member Number and clicks the View button.

In the aspx file, I have OnClick for the View button call the cmdView_Click
function in my code-behind. The OnClientClick is defined to "return
validateForm();"; in other words, to execute the Javascript function
mentioned in the first paragraph. Since the AJAX ModalPopupExtender requires
a TargetControlID, I have it pointing at my View button.

I can modify my Javascript function to allow it to branch either of two ways
depending on whether a Member Number or a Social Security Number is entered,
but is there anyway to somehow tie the AJAX ModalPopupExtender back in to my
Javascript function rather than the View button so as to force the popup to
display ONLY if a Social Security Number has been entered?


May 30 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.