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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:14:08+00:00 2026-05-13T18:14:08+00:00

I have a problem with my form submission and here is the deal. I’m

  • 0

I have a problem with my form submission and here is the deal. I’m creating an image website and I want to create comments for every image so I have a anchor link which when clicked on shows the comments form, that is loads the html into the web page which wasn’t inside at first place, so the form loaded inside the page is not submitting.

Is it possible that forms which are dnynamicly loaded into webpage can’t submit? what can be other problems with this? I even tried putting something like <a href="#" id="test">Click me</a> inside the loaded content and I added

$("#test").click(function(){
alert("SOMETHING");
});

to my javascript and it won’t alert as well.. what am I doing wrong ?

EDIT

Ok here is how I load form ..

I have an anchor link below my image :

<a href="javascript:;" onclick="showComments('22');" class="answer_comment">Add image content</a>

Here is javascript which is outside document ready function :

function showComments(post){
         var xHTML = "<div class=\"addComment\">";
         xHTML += "<form action=\"<?=base_url()?>images/post_comment/" + post + "\" method=\"post\" id=\"comment_form\" name=\"comment_form\">";
         xHTML += "<input type=\"hidden\" id=\"comment_post_id\" name=\"comment_post_id\" value=\"" +post + "\"/>"; 
         xHTML += "<textarea name=\"comment_text\" class=\"comment\" rows=\"8\" cols=\"40\"></textarea>";
     .....

Like this I fill up my comments form.. need more code ?

  • 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-13T18:14:08+00:00Added an answer on May 13, 2026 at 6:14 pm

    Dynamically loaded elements have to be rigged up as well in your case to alert, you want:

    $("#test").live('click', function() {
      alert("SOMETHING");
    });
    

    This will fire for any element with id="test", whether it’s ajax loaded or not. The same style should be used for whatever handler you want to use. Read the .live() documentation for the full story…basically it sits up at the root DOM level listening for clicks and acts on them, so it doesn’t care what was or wasn’t there when you defined the event handler, which is what you want for dynamically loaded content.

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

Sidebar

Related Questions

Here is the problem. In my php submission page, I have a form with
I have a problem in firefox, where I'm trying to get a form submission
I have a problem with dojox.form.Uploader. I want to use it to attach files
I have a little problem with javascript form submit issue, here is the script
We have here a strange issue. We have a comments form where users can
I have little problem with form and I am using js for validation. Here
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with a long form in iOS. The form itself is done
I have problem with show or hide form in Window Form Application. I start
I have problem with TinyMCE editor. I have form with few text fields and

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.