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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:45:39+00:00 2026-06-04T20:45:39+00:00

If I have this form which submits the post data to the page itself:

  • 0

If I have this form which submits the post data to the page itself:

<form method="post">
   <input type="text" name="name"/>
   <input type="submit"/>
</form>

How will I be able to use JavaScript/jQuery to inject an additional POST data. This would be easier if I only submit the form via ajax using any of the functions like $.post(), $.get(), or $.ajax(). But what I want to do here is to submit the form not via ajax.

The additional data is in JavaScript. I’m thinking of just injecting a new hidden field into the DOM in which I will pass in the data so that it gets submitted with the form, but is there other way of doing it?

Please comment if you need more code/explanation.

  • 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-04T20:45:41+00:00Added an answer on June 4, 2026 at 8:45 pm

    Rather than using a submit button, use a regular button and control the submission via Javascript. In your javascript, you need to serialize the form and pass it as data along with anything else you want.

    <script>
    
        $(document).ready(function() {
    
           var extra_data = "This is more stuff to send";
    
           $('#submit').click(function() {
              $.ajax({
                 type: "POST",
                 url: "form.php",
                 data: {'form': $("#my_form").serialize(), 'other': extra_data},
                 success: function(msg) {
                    alert("Form Submitted: " + msg);
                 }
              });
    
           });
    
        });
    
    </script>
    
    <form id="my_form" method="post">
      <input type="text" name="name" />
      <input type="button" id="submit" />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form tag below where the form submits to itself which I
Lets say we have a web page with a search input form, which submits
I have this form which allows the input of any product quantity from 1-10:
I have an input which is of this form: (((lady-in-water . 1.25) (snake .
I have a page which has lot of post data in the url. For
I have a page which submits a form on page load and redirects the
i have a form that submits some data and gets html back. this html
I have a form which posts data to the same page. Based on the
I have a form which has First Name, Last Name text boxes, Radio button(Yes
I have this code which posts data to a page and returns data. This

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.