1

同じページに 2 つの異なるフォームがあります。

<form action="" method="post" onsubmit="ajax_send('<?print $userid;?>',this.msg.value); return false;">
<input id="msg" autocomplete="off" type="text" name="msg" stlye="width: 80px;" autofocus="autofocus" placeholder="Chat here" />
<input type="submit" />
</form>

<form action="?page=about&id=0#comments" method="post">
<textarea class="editbox" id="exitbox" placeholder="Write a comment ..." name="newcomment"></textarea>
<input type="submit" id="submit1" name="submit1"></div></div>

何かを入力して Enter キー<input id="msg"..>を押すと、最初のフォームではなく 2 番目のフォームが送信されます。

私は何が欠けていますか?

4

2 に答える 2

7

2 番目のフォームが閉じられていません。

于 2012-08-20T01:28:28.720 に答える
2

あなたの2番目のフォームはそのようにする必要があります

<form action="?page=about&id=0#comments" method="post">
<textarea class="editbox" id="exitbox" placeholder="Write a comment ..." name="newcomment"></textarea>
<input type="submit" id="submit1" name="submit1"></div></div>
</form>
于 2012-08-20T02:11:01.460 に答える