Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7191245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:41:15+00:00 2026-05-28T19:41:15+00:00

Seeking some help to determine what the heck is the issue as to why

  • 0

Seeking some help to determine what the heck is the issue as to why I am not able to bind an event from my modal box to the onShow. I can see the onShow is being triggered if I just put in an alert message. But what I really want to do is capture the the Reset event and use that to trigger an ajax call back to the service to send out an email to the user.

I use the following to create the modal:

<li class="actions-text"><a class="modal-s" href="modal/modal-password.jsp">Forgot Password?</a></li>

This will then trigger the following java script:

    $('.modal-s').click(function (e) {
        $.modal('<iframe src="' + this.href + '" height="230" width="480" scrolling="no">', {
            overlayClose:true,
            onOpen: function (dialog) { 
                dialog.overlay.fadeIn('slow', function () { 
                    dialog.container.slideDown('slow', function () {
                        dialog.data.fadeIn('slow');
                    });
                });
            },
            onClose: function (dialog){ 
                dialog.data.fadeOut('slow', function () {   
                    dialog.container.slideUp('slow', function () {
                        dialog.overlay.fadeOut('slow', function () {
                            $.modal.close(); 
                        });
                    });
                });
            },
            onShow: function (dialog) {
                $("form", dialog.data).submit(function () {
            alert('submitting the form');
            parent.jQuery.modal.close();
                });
            }
        });
        return false;
    }); 

The modal is:

            <form name="resetPasswordForm" id="resetPasswordForm">
            <dl class="form">
                <dt><label>Email:</label></dt>
            <dd><input type="email" id="passwordResetEmail" name="passwordResetEmail"/></dd>
            <dd class="clear">&nbsp;</dd>
                </dl>
            <ul class="actions">
                <li class="actions-submit"><input type="submit" class="button" value="Reset" id="submitPasswordReset" name="submitPasswordReset"/></li>
                </ul>
            </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:41:17+00:00Added an answer on May 28, 2026 at 7:41 pm

    The core of the problem is the use of the iframe to load an external file. When you add this selector to SimpleModal’s onShow:

    $("form", dialog.data) 
    

    …it evaluates to:

    $('div#simplemodal-data.simplemodal-data form')
    

    But because of the iframe your DOM is actually:

    <div id="simplemodal-data" class="simplemodal-data" style="">
      <iframe width="480" scrolling="no" height="230" src="http://192.168.0.189:8082/sm/modal-password.php"></iframe>
    </div>
    

    Which means that if it was possible you would really be needing a selector like:

    div#simplemodal-data.simplemodal-data > iframe > html > body > form
    

    Of course you cannot access an iframe that way, and similarly, you can not capture a click in the iframe and have the event bubble up to the parent page.

    I’m surprised this is SimpleModal’s solution to external content.

    Two solutions I can think of are 1) add the external content to a hidden div on the same page or 2) use jQuery’s load() method to populate an empty div on the page and then show the modal.

    Option 1 looks like this:

    <a class="modal-s" href="#">Forgot Password?</a>
    <!-- hide this div in css -->
    <div id="modal-content">
      <form name="resetPasswordForm" id="resetPasswordForm">
        <dl class="form">
          <dt>
            <label>
              Email:
            </label>
          </dt>
          <dd>
            <input type="email" id="passwordResetEmail" name="passwordResetEmail"/>
          </dd>
          <dd class="clear">
            &nbsp;
          </dd>
        </dl>
        <ul class="actions">
          <li class="actions-submit">
            <input type="submit" class="button" value="Reset" id="submitPasswordReset" name="submitPasswordReset"/>
          </li>
        </ul>
      </form>
    </div>
    

    JS:

    $('.modal-s').click(function(e){
      $('#modal-content').modal({
        overlayClose: true,
        onOpen: function(dialog){
          dialog.overlay.fadeIn('slow', function(){
            dialog.container.slideDown('slow', function(){
              dialog.data.fadeIn('slow');
            });
          });
        },
        onClose: function(dialog){
          dialog.data.fadeOut('slow', function(){
            dialog.container.slideUp('slow', function(){
              dialog.overlay.fadeOut('slow', function(){
                $.modal.close();
              });
            });
          });
        },
        onShow: function(dialog){
          $("form", dialog.data).submit(function(){
            alert('submitting the form');
            parent.jQuery.modal.close();
          });
        }
      });
      return false;
    });
    

    Option 2:

    <a class="modal-s" href="#">Forgot Password?</a>
    <!-- hide this div in css -->
    <div id="modal-content"></div>
    

    JS:

    $('.modal-s').click(function(e){
      //note use of load()
      $('#modal-content').load('modal-password.php', function(){
        $('#modal-content').modal({
          overlayClose: true,
          onOpen: function(dialog){
            dialog.overlay.fadeIn('slow', function(){
              dialog.container.slideDown('slow', function(){
                dialog.data.fadeIn('slow');
              });
            });
          },
          onClose: function(dialog){
            dialog.data.fadeOut('slow', function(){
              dialog.container.slideUp('slow', function(){
                dialog.overlay.fadeOut('slow', function(){
                  $.modal.close();
                });
              });
            });
          },
          onShow: function(dialog){
            $("form", dialog.data).submit(function(){
              alert('submitting the form');
              parent.jQuery.modal.close();
            });
          }
        });
      });
      return false;
    });
    

    Note: this is clunky because it will pull the external data every time the triggering link is clicked. It might be wiser to see if it has already loaded and save the extra calls, but you get the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple issue with datetime and am seeking some help. I
I am newbie in Ruby.. seeking some help.. I have a code DB =
Seeking some basic help, probably a typo in code. I have the following: create
In brief : I'm new to rails and am seeking some help regarding the
i want your help very badly..bcz i am seeking an answer for this from
could some one help me out trying to understand how hard drive seeking works.
I am seeking help with trying to fix my background image fill issue. I
I really have not worked much with XML and I would appreciate some help.
Seeing some strange things; help is being solicited. I have a query, like so:
I'm implementing drag & drop from a ListBox, but I'm seeing some strange behaviour

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.