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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:02:05+00:00 2026-06-13T13:02:05+00:00

I have a webpage that uses jquery.load() to pull in html code populated with

  • 0

I have a webpage that uses jquery.load() to pull in html code populated with php values pulled from a database.

$(function() {
console.log("Starting .load");
$("#stream").append($("#slipp-container").load("includes/databaseslippsAJAXserverside.php .slipp-container"));
});

I want to be able to add comments to one slipp out of many, without refreshing the page.

Each slipp consists of basic information about the slipp, plus user comments that databaseslippsAJAXserverside.php loads separately.

The issue is for each slipp, there is also an “add comment” box, which is just a textarea with a submit button.
$value["ID"] is the unique ID of the slipp. I thought I could use a hidden field to pass the username, and the function call itself to pass the ID of the slipp, but I have no idea where to go from there.

<form id="<?php echo $value["ID"]; ?>">
<textarea rows="4" cols="30"></textarea>
<input type="hidden" value="<?php echo $_SESSION["user"]; ?>" name="formUser">
<input type="submit" value="Add Comment" class="commentbutton" id="CCB<?php echo $value["ID"]; ?>" action="javascript: addComment(<?php echo $value["ID"]; ?>)">
</form>

There could be upwards of 100 slipps on a page at any one time (Facebook style), so how do I have one function that submits the form data to the relevant php file for inclusion in the database, without refreshing the page?

I’m fairly certain that .load() basically discards all javascript it loads in, which is why I cannot simply have a unique, php generated javascript attached to each slipp.

  • 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-13T13:02:06+00:00Added an answer on June 13, 2026 at 1:02 pm
    1. add class to your form:

      <form id="<?php echo $value["ID"]; ?>" class="comments">
      <textarea rows="4" cols="30"></textarea>
      <input type="hidden" value="<?php echo $_SESSION["user"]; ?>" name="formUser">
      <input type="submit" value="Add Comment" class="commentbutton" id="CCB<?php echo $value["ID"]; ?>" action="javascript: addComment(<?php echo $value["ID"]; ?>)">
      </form>
      
    2. in javascript set handler to form submit:

      $(function() {
       $('form.comments').submit(function(e) {
          $.post('myformhandler.php',data: $(this).serializeArray(),function(data) {
           /* Add an action here performed on success loading, 
              use data as returned value; */
           });
          return false;
       }
      );
      });
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple webpage that uses the jquery template plugin to dynamically load
I have a webpage that uses an iFrame (see http://little-apps.org/lilregcleaner/history.html ) and (of course)
I currently have a program that basically reads html from a webpage. After sending
I have a page that uses jQuery tabs to tabify a set of HTML
I have made webpage that uses Ajax to update some values without reloading the
I have a webpage that heavily uses Javascript (AJAX requests, Google Maps API, HTML
I have a webpage that uses JavaScript to retrieve JSON from a web service.
I have a webpage that uses the special character &#xFE3E in the HTML. In
I have a web page that uses the following code: <!DOCTYPE html> <html style=height:
I have a web page that uses jquery ajax to grab the table markup

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.