troubleshooting Question

How to change Modal Box content data based on user click

Avatar of MikeCombe
MikeCombeFlag for United States of America asked on
15 Comments1 Solution579 ViewsLast Modified:
I am trying to display 2 hyperlinks "Dog" and "Cat".
When the user clicks on "Dog" the modal popup displays "dog data".
When the user clicks on "Cat" the modal popup displays "cat data".
I can get the modap popup to display....but I am not sure how to determine which
hyperlink was clicked, so I can set the proper modal display data.

I tried using <a href='default.aspx?pet=cat' class='basic'>Cat</a>
but it doesn't appear that the modal box is reading session variables that I set
during the postback.

The modal system I am using is by:

It uses these jQuery files:
<!-- Load jQuery, SimpleModal and Basic JS files -->
<script type='text/javascript' src='modal/basic/js/jquery.js'></script>
<script type='text/javascript' src='modal/basic/js/jquery.simplemodal.js'></script>
<script type='text/javascript' src='modal/basic/js/basic.js'></script>

I was hoping I can handle the user clicks via postback or jscript instead of
getting inside the jquery files.

any ideas ?

<div id='container'>
      <div id='content'>
            <div id='basic-modal'>
            <input type='button' name='basic' value='Demo' class='basic'/>
                                   or <a href='#' class='basic'>Dog</a>
                                   or <a href='#' class='basic'>Cat</a>

            <!-- modal content -->
            <div id="basic-modal-content">

            <!-- preload the images -->
            <div style='display:none'>
                  <img src='modal/basic/img/basic/x.png' alt='' />
Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros