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 8200685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:32:05+00:00 2026-06-07T06:32:05+00:00

I used the following to create a modal window: function openAdminModal(dObj, content) { var

  • 0

I used the following to create a modal window:

function openAdminModal(dObj, content) {
    var modal = $.modal({
        title: dObj.title,
        closeButton: true,
        content: content,
        width: false,
        resizeOnLoad: true,
        buttons: {
            'Submit': function (win) {
                submitHandler(dObj.$link, $('#main-form'), false);
            },
            'Close': function (win) {
                win.closeModal();
            }
        }
    });
}

I am not sure this helps with the question but I am adding it just in case.

The modal it creates has the following:

<div id="modal" style="display: block;">
....
    <button type="button">Submit</button>

The button is not inside of a form and the code around the button can’t be moved. What I would like to do is to use jQuery to add an event to this button so that when it is clicked the following function is fired.

submitHandler(dObj.$link, $('#main-form'), false);

Can someone explain to me how I can use jQuery to add the calling of the function to the click event of the button. One thing I am not sure of is HOW can I select that button as it has no ID. The only thing it has is text of “Submit”. Can I use the value of the variable modal that’s on line 2 of the first code when doing my search?

  • 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-06-07T06:32:07+00:00Added an answer on June 7, 2026 at 6:32 am

    Try this,

    Live Demo

    $('button:contains("Submit")').click(function(){
      submitHandler(dObj.$link, $('#main-form'), false);
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used following JS code to create equal height columns: var colHeight = Math.max($('.3columngallery
I used the following create statement: CREATE TABLE `subscr` ( `id` int(11) NOT NULL
I have used following code to create a simple PDF file. It executes fine
I have the following used to create a dummy high score table if if
I've always used the following codes to create a folder on a Apache server
I've used the following code, taken from here , to create my own custom
I think the following code can be used to create manipulators. #include<iostream> ostream &
I am mostly following this page: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html I used this command to create the
Let's say I used the following command to create a User model: script/generate model
Is it possibile to create a modal dialog form following the singleton pattern? The

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.