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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:39:30+00:00 2026-05-22T00:39:30+00:00

I have the following code, with which i try to dynamically pass my arguments

  • 0

I have the following code, with which i try to dynamically pass my arguments between pages

<script type="text/javascript">
    function buildAndSubmitForm(index){
        <?  $args = 't='.$team.'&s='.$season.'&l='.$league.'&f='.$flag;
            $inputs = '';
            foreach($games as $game)
                $inputs .= '<input type="checkbox" name="games[]" id="games[]" value="'.$game.'" checked="checked" />';
        ?>
        var form = '<?='<form name="myForm" id="myForm" action="scr'?>';
        form = form.concat(index);
        form = form.concat('<?='.php?'.$args.'" method="post">'.$inputs.'</form>'?>');
        $('#formDiv').html(form);
        $('#myForm'.concat(index)).submit();
    }
</script>
<div style="display: inline">
    <div name="formDiv" id="formDiv" style="display: none;"></div>
    <a href="#" onclick="buildAndSubmitForm('a')">Home Stats</a>
    <a href="#" onclick="buildAndSubmitForm('b')">Visit Stats</a>
    <a href="#" onclick="buildAndSubmitForm('c')">Wins VS Losses</a>
    <a href="#" onclick="buildAndSubmitForm('d')">Home VS Visit</a>
    <a href="#" onclick="buildAndSubmitForm('e')">Overall</a>
</div>

The problem is that when i click at a certain speed (click on a link, then as it is getting submitted (like a half a second – second later) I click another link), my form gets submitted empty to the second link I’ve clicked.
Why is this happening?

EDIT:
Tryed to do the following instead:

<div style="display: inline">
    <a href="<?php echo "scra.php?t=$team&s=$season&l=$league&f=$flag"; foreach($games as $game) {echo "&game=$game"; }?>" >Home Stats</a>
    <a href="<?php echo "scrb.php?t=$team&s=$season&l=$league&f=$flag"; foreach($games as $game) {echo "&game=$game"; }?>" >Visit Stats</a>
    <a href="<?php echo "scrc.php?t=$team&s=$season&l=$league&f=$flag"; foreach($games as $game) {echo "&game=$game"; }?>" >Wins VS Losses</a>
    <a href="<?php echo "scrd.php?t=$team&s=$season&l=$league&f=$flag"; foreach($games as $game) {echo "&game=$game"; }?>" >Home VS Visit</a>
    <a href="<?php echo "scre.php?t=$team&s=$season&l=$league&f=$flag"; foreach($games as $game) {echo "&game=$game"; }?>" >Overall</a>
</div>

EDIT2:
None of the solutions work yet.

  • 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-22T00:39:31+00:00Added an answer on May 22, 2026 at 12:39 am

    If you want to prevent double-clicks, you need to disable the link after it’s been clicked. Here is a previous SO question that provides an jQuery solution to disabling links:

    jQuery disable a link

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

Sidebar

Related Questions

I have the following JavaScript code: Link In which the function makewindows does not
I have the following code, which will not work. The javascript gives no errors
I have a following code which works fine MsgBox(AddSomething(Of String)(Hello, World)) Public Function AddSomething(Of
I'm trying to use opengl in C#. I have following code which fails with
I have following Code Block Which I tried to optimize in the Optimized section
I have the following code which works just fine when the method is POST,
I have the following code which works fine. However, I only want to return
Okay so I have the following Code which appends a string to another in
I have the following JQuery code which does similar functionality like Stackoverflow where the
I have the following piece of code which replaces template markers such as %POST_TITLE%

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.