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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:23:05+00:00 2026-05-31T22:23:05+00:00

I have a form and I need to add some data from database before

  • 0

I have a form and I need to add some data from database before submiting it.
My html code is:

<form action="https://91.199.226.106/services/authorize.php" id="arca" method="POST">
        <input type="hidden" name="hostID" id="hostID"/>                                                                                                                                                                                                                                            
        <input type="hidden" name="mid" id="mid" />
        <input type="hidden" name="tid" id="tid" />
        <input type="hidden" name="additionalURL" id="additionalURL" />
        <input type="hidden" name="orderID" id="orderID" />
        <input type="hidden" name="currency" id="currency" />
        <input type="hidden" name="opaque" />
        amount<input type="text" name="amount" id="amount" value="" /><br>
        <input type="submit" value="submit" />
    </form>
    <div id="script_area"></div>
    <div id="error_area"></div>

And I have an event handler for form submit. Here is the code:

$("#arca").submit(function(e){
            e.preventDefault();
            var data="amount="+$("#amount").val()+"&&lang=eng";
            $.ajax({
                url: "ajax/get_arca_submit_params.php", 
                type: "POST",       
                data: data,     
                cache: false,
                success: function (html) {
                    var splited=html.split("|",2);
                    if(splited[0]=="0")
                    {
                        $("#error_area").html(splited[1]);
                    }
                    else
                    {
                        $("#script_area").html(splited[1]);
                        $("#arca").submit();
                        //alert("aaaaa");

                    }
                }   
            });
        });

The PHP returns

“0|error message” or “1|script that sets fields values” that I place
in the div with id=”script_area”

. The problem is that $("#arca").submit(); line ceeps on submiting the form on and on. How can I solve this problem? Thanks for help.

  • 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-31T22:23:07+00:00Added an answer on May 31, 2026 at 10:23 pm

    Replace $("#arca").submit(); with $("#arca")[0].submit();. This way you are calling the submit event on the underlying DOM element which won’t trigger your callback and avoid the infinite loop.

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

Sidebar

Related Questions

Hoi! I have a form I wish to submit, but I need to add
i have a form button in the form,which i need to perform basic action
I have a form builder class which inherits from AbstractType and I need to
I have a form which is submitted to a PHP page. The data from
I have an html table that pulls data from a DB. It has an
I have a form MyForm : System.Windows.Forms.Form {} and I need to call Site.GetService(..)
I have an InfoPath form which I need to conditionally disable it's OnChange events.
I need to make the program which have one form that contains PNG image
I have a form that is sending in sizes of things, and I need
I have a form that excepts a file upload in ASP.NET. I need 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.