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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:36:19+00:00 2026-05-13T18:36:19+00:00

From This answer and the fact i may be using an anti pattern I

  • 0

From This answer and the fact i may be using an anti pattern I thought i should change the ajax call into behavior like submitting a form. I found $.post but that seems to be doing ajax and does not change the page i am on.

How do i submit a form with jquery or plain JS?

  • 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-13T18:36:19+00:00Added an answer on May 13, 2026 at 6:36 pm

    It’s as simple as calling the $.submit() method on the form itself:

    $("#formID").submit(); // jQuery
    document.getElementById("formID").submit(); // Javascript
    

    Or if you’re using the name attribute only:

    $("form[name='formName']").submit(); // jQuery
    document.formName.submit(); // Javascript
    

    If you’re only interested in redirecting the page after you submit the data, you could do this from the callback of the $.post() call:

    $.post("process.php", { 'foo':$(".bar").val() }, function(result) {
      window.location = "thanks.php";
    });
    

    Update:

    The asker indicated in the comments below that no form actually exists. I would suggest creating one:

    var myForm = $("<form>")
                   .attr({'method':'post','action':'process.php'})
                   .appendTo("<body>");
    

    And then adding your data:

    $("<input>")
      .attr({'type':'hidden','name':'firstname'})
      .val("Jonathan")
      .appendTo(myForm);
    

    And later, when you’re ready, submit it:

    $(myForm).submit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From this question , a neat answer about using COALESCE to simplify complex logic
From this answer: When is a C++ terminate handler the Right Thing(TM)? It would
This came up from this answer to a previous question of mine . Is
I'm intrigued by this answer from another SO thread, and I was hoping someone
After reading this answer: best way to pick a random subset from a collection?
This question arose from the discussion in the comments of this answer . First,
This is a CSS related question, I got one good answer from my previous
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
In this answer , I use a regular expression search/replace to convert from one
The answer to this may very well be no, as much searching has turned

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.