-1

Please I have a issue with the script below, am using it to submit a for, it works well on chrome but it doesn't work on firfox, please what could be the problem.

        <script>
        var transac_code = <?php echo json_encode($transac_code); ?>;
        var amount = <?php echo json_encode($amount); ?>;
        //window.location.href = "web_pay.php?transac_code=" + transac_code + "&amount=" +amount;

        $('<form action="web_pay.php" method="POST">' + 
        '<input type="hidden" name="transac_code" id="transac_code" value="' + transac_code + '">' +
        '<input type="hidden" name="amount" id="amount" value="'+ amount +'" />' +
        '</form>').submit();

    </script>

thanks for your assistance

Liam
  • 27,717
  • 28
  • 128
  • 190

1 Answers1

0

You need to append the form the document.

$("...").appendTo(document.body).submit();
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
epascarello
  • 204,599
  • 20
  • 195
  • 236