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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:28:35+00:00 2026-06-02T20:28:35+00:00

I have a form and when the form is loaded through a browser, I

  • 0

I have a form and when the form is loaded through a browser, I want it to submit the data automatically.

The problem is I wrote a PHP script that will submit it all fine on a test form. My problem is the server I’m trying to submit the data to named the button "submit".

Here is the example form:

<html>

<head>
</head>

<form  action="http://www.example.com/post.php"  method="post">
    <input type="text" name="input1" value="test1"  />
    <input type="text" name="input2" value="test2"  />
</form>

<script type="text/javascript">
    document.forms[0].action="submit"
</script>

</body>

</html>

The person that created the form on the other server named it "submit". Is there a workaround until they fix it?

Here is a example of the person’s form

<html>

<head>
</head>

<form  action="http://www.example.com/post.php"  method="post">
    <input type="text" name="input1" value="test1"  />
    <input type="text" name="input2" value="test2"  />
    <input type="submit" name="submit" class="submit" value="Send Data" />
</form>

</body>

</html>
  • 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-06-02T20:28:36+00:00Added an answer on June 2, 2026 at 8:28 pm

    You want to submit the form? Then simply use its submit() method:

    document.forms[0].submit();
    

    If the server expects submit to be POSTed, i.e. the button being clicked, you can simply trigger the click() event of the button. Since you cannot access it using its name, I’d use jQuery for it:

    $('input[name="submit"]').click();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a contact edit form. The entire form is requested through ajax (loaded
I have a form that's calling a Post a .php file, which i though
I have a form to 'create a tag'. Using the jQuery code below. $(#createtag).submit(function()
I have a global form which I want to use the same form every
Here's my issue: I have a html form that after a user fills in
I'm trying to put together some jQuery code that will add form elements (input
I have forms inside a cakephp app that load through ajax. These forms have
I have a form that has hidden elements in it to create a pseudo-array
I have a homework assignment that asks to create an order form. The order
I have a search function that returns an arraylist of objects to my form.

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.