1

I have got two different forms on the same page.

<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>

and

<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>

Now when I enter something in <input id="msg"..> and press enter, it submits the second form instead of the first one.

What am I missing?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
user1211030
  • 2,680
  • 2
  • 19
  • 22

2 Answers2

7

Your second form isn't closed.

Script47
  • 14,230
  • 4
  • 45
  • 66
Jared Drake
  • 982
  • 4
  • 12
2

Your second form should by like that

<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>
  • BTW your answer fixed my similar problem, so I added this solution to this question: http://stackoverflow.com/questions/10313032 – Krista K Jun 03 '14 at 07:43