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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:49:41+00:00 2026-05-28T07:49:41+00:00

I am having two problems. First: Trying to submit this form using jquery. When

  • 0

I am having two problems.

First: Trying to submit this form using jquery. When I hit submit nothing happens, no data is submited but everything else works.

Second: When I click submit the message appears and then when I hit close the box closes,
how can I reload the popup div so that when the link is clicked again it doesn’t show
the message or the last action.

<script type="text/javascript">
$(document).ready(function(){ 
    $('#popbox').click(function(){
        $('#form').submit(function(){
            $.post('url.php', function(data){
                var message = 'some text';
                $('#popbox').html('message');
            });
            return false;
        });
        $('#closeForm').click(function(){
            $('#popbox').fadeOut(); 
        });
    }); 
}); 
</script> 

HTML Code:

<div id="popbox">
    <form id="form" method="post" action="" >
        <input type="radio" name="option" value="text1" />text1 <br>
        <input type="radio" name="option" value="text2" />text2<br>
        <br><input type="submit" name="sendData" value="send"/>
    </form>
    <div style="margin:auto; border:1px gray groove ; padding:2px 7px 2px 5px; clear:both; width:30px;border-radius:5px;"><a id="closeForm">close</a></div>
</div>
  • 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-28T07:49:41+00:00Added an answer on May 28, 2026 at 7:49 am

    You have to add the forms data to the AJAX request. To do this we can use jQuery’s .serialize() function:

            $.post('url.php', $(this).serialize(), function(data){
                var message = 'some text';
                $('#popbox').html('message');
            });
    
    • Docs for .serialize(): http://api.jquery.com/serialize
    • Docs for $.post(): http://api.jquery.com/jquery.post
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having two unexpected problems using Queue from the STL Library: 1) I'm trying
I'm having some problems trying to perform a query. I have two tables, one
I'm trying to merge two main menus together, but am having problems getting the
I know this is probably a first year question, but I'm having some problems
I'm learning stored procedures/functions/triggers in MySQL this morning and I'm having some problems trying
I was having problems while intersecting two geometries, getting a TopologyException probably due to
I'm having some problems displaying the contents of one NSArrayController in two windows defined
We are having some problems deploying our WCF services into IIS7. We have two
So i'm having this problem. I have two tables (Oracle), one is called Destination
Having two forms, each in it's own jQuery UI tab, how can I post

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.