データを送信しようとしているリモートサーバーにフォームがあります。例は次のとおりです。
<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>
このようなデータを自動送信しようとしています
<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>
最初の例に(name = "send")名がない場合は正常に機能しますが、名前がある場合は何も送信されません。私の質問は、名前の付いた入力ボタンを使用してデータを送信するにはどうすればよいかということです。
ありがとうございました