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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:35:27+00:00 2026-06-05T17:35:27+00:00

Possible Duplicate: how to get GET and POST variables with JQuery? I have the

  • 0

Possible Duplicate:
how to get GET and POST variables with JQuery?

I have the following HTML:

<form action='.' method='post'>{% csrf_token %}
    <div class="parameters">
        Show
            <select name="earnings_filter">
                <option value="all">Total earnings</option>
                <option value="hd">HD earnings</option>
                <option value="sd">SD earnings</option>
            </select>
        <input type="submit" name="submit" class="submit float-right" value="submit" id="submit_financials"/>
    </div>
</form>

I need to do an ajax call with this, which I’m triggering on:

$("#submit_financials").live('click', function(){
    ...
});

Is there a way to get the variables that are submitted in POST, for example which option was selected (and there are about 10 other variables I need to get). Or do I need to use the jQuery selectors to get the value of each?

  • 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-05T17:35:29+00:00Added an answer on June 5, 2026 at 5:35 pm
    $("#submit_financials").live('click', function(){
        $.ajax({
          url: '', // script url to send
          method: 'POST', // method of sending
          data: $('form').has(this).serialize(),  // .serialize() make query string with form inputs name and value
          dataType:'json',  // expected data format returned from server, you may have something else
          success: function(response) {
              // response contains data returned from server
          }
        });
    });
    

    It would be better replace live() with .on() if you’re using jQuery > 1.7 and it’d be better if possible. So you can write it

    $("#container").on('click', '#submit_financials', function(){
        $.ajax({
          url: '', // script url to send
          method: 'POST', // method of sending
          data: $('form').has(this).serialize(),  // .serialize() make query string with form inputs name and value
          dataType:'json',  // expected data format returned from server, you may have something else
          success: function(response) {
              // response contains data returned from server
          }
        });
    });
    

    Here #container point to holder of #submit_financials that belong to DOM at page load.

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

Sidebar

Related Questions

Possible Duplicate: Avoid resending forms on php pages Index.html <form method=post action=demo.php> <input type=text
Possible Duplicate: jQuery ajax() vs get()/post() what is the difference between jQuery ajax() and
Possible Duplicate: Variables upon submitting Paypal form //Buy.php <form action=https://www.paypal.com/cgi-bin/webscr method=post> <input type=hidden name=cmd
Possible Duplicate: jQuery $.get or $.post to catch page load error (eg. 404) Maybe
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
Possible Duplicate: How secure is a HTTP POST? Suppose I have a login page
Possible Duplicate: jquery trigger - ‘change’ function I have a radio button set called
Possible Duplicate: The ultimate clean/secure function When it comes to sanitizing POST/GET data could
Possible Duplicate: get the value of an url response with curl I have an
Possible Duplicate: Enter button on Keyboard refreshes rather than submitting I have the following

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.