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

  • Home
  • SEARCH
  • 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 9018237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:28:28+00:00 2026-06-16T04:28:28+00:00

The short question is when I fill a <div> containing a type=submit button the

  • 0

The short question is when I fill a <div> containing a type=submit button the .click(function(){...} function fails.

What I’m doing is this, #formDialogButton opens #accordion populated by .ajax() containing #userForm with an input type=submit. When client clicks submit it is supposed to fire .ajax() where php does database stuff and returns one of the #userform.

            $(".formDialogButton").click(function(){
            var userDialog = "#" + this.id + "Dialog";
            $("#userForm, #siteForm, #limitForm").html("<img src='ajax-loader.gif' />");
            $("#userForm, #siteForm, #limitForm").load("ajax.php", {op: "forms"}, function(responseTxt,statusTxt,xhr){
                $("#userForm").html($("#user").html());
                $("#siteForm").html($("#site").html());
                $("#limitForm").html($("#limit").html());
                if(statusTxt=="success") {
                    $(userDialog).dialog({
                        autoOpen: false,
                        draggable: true,
                        modal: true,
                        resizable: true,
                        width: 700,
                        position: { within: "#mainContent" }
                    });
                    $(userDialog).dialog("open");
                    $( "#accordion").accordion({ 
                        collapsible: true,
                        heightStyle: "content",
                    });
                };
                if(statusTxt =="error")
                    alert("Error: "+xhr.status+": "+xhr.statusText);
            });
        });  

This is working and returns a <input class="submitAndReturn" type="submit" value="Submit" /> in the form. But I can’t “find” it to do anything.

            $(".submitAndReturn").click(function() {
        alert ('this is where I call my regular .formSubmitButton and let  success: function() do a .formDialogButton ');
        });  

I’m a total self taught amateur so please forgive me and try to help. Thanks

  • 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-16T04:28:30+00:00Added an answer on June 16, 2026 at 4:28 am

    Sounds like you are trying to add the click event before the element is loaded on the page. Change

    $(".submitAndReturn").on("click", function() {
        alert ('as .submit and return is dynamically loaded. so, use on function');
    }); 
    

    to

    $(document).on("click", ".submitAndReturn", function(e) {
        e.preventDefault(); //cancel the click action if needed
        alert ('as .submit and return is dynamically loaded. so, use on function');
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short question, is the following ok: struct X { A& x; A y; X()
Short question: Is it possible to detect window.open() in a UIWebView using the UIWebViewDelegate
Short Question: Can I specify wildcards for custom console folding? If so, what is
Short Question: What is the importance of isomorphic functions in programming (namely in functional
Short question: Do any of MS's built in Data Objects support INotifyPropertyChanged? Long explination:
Short question - how do you define your view models? Here are some of
Short question: Is it possible to do a redirection, say when a user isn't
Short question: Is the parent of an entity group included in that entity group
Short question. How do you go about transposing UML diagrams into code? The class
Short question: I'm trying to make that in a given page (uses tabs) back

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.