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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:29:48+00:00 2026-06-09T17:29:48+00:00

I have a form on a remote server I’m trying to submit data to,

  • 0

I have a form on a remote server I’m trying to submit data to, example below

<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="send" value="Submit" />
</form>
</body>
</html>

I’m trying to auto submit the data like this

<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"  />
<script type="text/javascript"> 
 document.forms[0].submit(); 
</script> 
</form>
</body>
</html>

It works fine if the first example didn’t have a (name=”send”) name but when it does have a name nothing submits. My question is how would I go about sending the data with a input button that has a name.

Thank you

  • 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-09T17:29:50+00:00Added an answer on June 9, 2026 at 5:29 pm

    Note: The answer turned out to be type="hidden" instead of type="submit", in which the second does not allow DOM submission while also submitting that input‘s value in the GET/POST data. type="hidden" does, and it works here since the button does not need to be physically clicked.


    Pick one:

    <form name="formname" id="formid" 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="send" value="Submit" />
    </form>
    <script type="text/javascript">
    if (confirm('Ok for "formname", Cancel for "getElementById"')) {
        console.log('document.formname.submit()');
        document.formname.submit();
    } else {
        console.log('document.getElementById("formid").submit()');
        document.getElementById('formid').submit();
    }
    </script> 
    

    http://jsfiddle.net/userdude/EAmwj/3

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

Sidebar

Related Questions

I have a contentPane with a remote form, I'm trying to get the form
I have a Rails app and trying to make a remote form, so far
I am trying to create simple user registration form. I have an index.html file
I have this code on javascript, var path = 'remote site action.php'; var form
I am using rails 2.3 and have a problem. I have remote form, and
I have a remote form for updating one of my objects. However, after updating,
I have an app that connects to a remote chat server and then the
I have a remote server which handles various different commands, one of which is
I have an array of checkboxes in a complex dynamic-html form. Whenever a user
I am trying to develop C# app where I want to have login 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.