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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:47:48+00:00 2026-05-27T04:47:48+00:00

I have the following working form: <div id=player_won> <form action=insert.php method=post> Firstname: <input type=text

  • 0

I have the following working form:

<div id="player_won">
<form action="insert.php" method="post">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Score: <input type="text" name="score" />
<input type="submit" />
</form>
</div>

When clicking submit, it will submit the data to my database. All works great. The only downside is that it will show this insert.php file after a succesfull submit.

Now I also have the following trigger:

function gameWon(){ 
 var $game_board = $("#game_board_container");
 var $player_won = $("#player_won");
 $player_won.show();
 $game_board = $player_won = null;
};

When this happens, it will show the div where the form is in. Since all the fields are already pre-filled, I also want to submit the form at the same time, automaticly, without needing to press the submit button. (but still show the form/div ofcourse)

How to do this? In addition, I also don’t want to be forwarded to the insert.php file. I just want the div to pop-up when triggert, submit the form at the same time, and do nothing else (The user can close the pop-up div himself if needed).

Hope you guys can help me out!

Kind regards,
Maurice

  • 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-27T04:47:48+00:00Added an answer on May 27, 2026 at 4:47 am

    To trigger a submit, just do $("form").submit() wherever you want to do a submit. To avoid going to insert.php file, add return false; at the end of the submit function.

    However, for this to work you’ll have to do an ajax post.

    E.g.:

    $(function(){
        $("form").submit(function(){
            $.ajax({
            //ajax post logic
            });
            return false;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I have the following html form <form action=/newPost id=submit_new method=get><div class=iwill> <div class=iwill-holder> <div
I have the following code submitting a form <div class=free-download> <input name=method_free value=<TMPL_VAR lang_free_download>
I have the following working tar -pcvf base.tar input/myPacket/my2 --exclude-vcs input/myPacket/my3/*.bmp When i have
I have the following form working just fine in Chrome, but doesn't seem to
I have the following snippet, which uses the jQuery Form plugin to post a
In tcsh , I have the following script working: #!/bin/tcsh setenv X_ROOT /some/specified/path setenv
On a Solaris 5.8 machine, I have the following code: [non-working code] char *buf;
I have the following regex that isn't working. I want to match the string
I have the following query which is working fine, but I also want to

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.