AJAX modal popup displays when it shouldn't

G

Guest

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?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top