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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:38:34+00:00 2026-06-04T04:38:34+00:00

I have been looking through StackOverflow a lot and found SOME solutions but they

  • 0

I have been looking through StackOverflow a lot and found SOME solutions but they don’t work for me 🙁 Probably because I can’t place the strings of code correctly.

I have a form which submits content to a database – and a script that loads the database inputs into a div below the form. It works realtime with a small delay.

<div id="addCommentContainer">

<form id="addCommentForm" method="post" action="">
    <div>
        
        <input type="hidden" name="name" value="<?php echo $loggedInUser->display_username; ?>"  id="name" />
        
        <input type="hidden" name="email" value="<?php echo $loggedInUser->email; ?>"  id="email" />
        
        <textarea name="body" id="body" cols="20" rows="5"></textarea>
        
        <input type="submit"  id="submit" value="Submit" />
    </div>
</form>

It works. I also have this script:
http://sandbox.jinoh.dk/script.js

I tried a solution onclick – but it made the content disappear not being posted. I tried onsubmit – but it didn’t work. What I want is the "comment" to be posted and then disappear from the form aka the form to be cleared.

Chatchatchat-div is the one that the comments are loaded into.

  • 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-04T04:38:35+00:00Added an answer on June 4, 2026 at 4:38 am
    $('#addCommentForm').submit(function(e){
      var form = this;
      .....
      ....
    
      $.post('submit.php',$(this).serialize(),function(msg){
        if(msg.status){
          form.reset(); // if you want to reset on msg status
        }
        ....                
      });
    
      this.reset(); // just reset the form what happen
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking through the questions asked on StackOverflow, but there are so
Looking through StackOverflow this question seems to be asked a lot, but I have
I have been looking through some code on an open source project recently and
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been looking through some MFC code and i came across this expression.
I have searched StackOverflow for some time now, but have not been successful so
I have been looking through the other questions on the site and have found
I've been looking through ctags man pages but I haven't found anything that will
I have been looking through some configuration files and I've seen both being used
I have been working with some bash scripting lately and been looking through 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.