在<输入>上按Enter键提交错误的< form> (2页1页) [英] Pressing Enter on a <input> submits the wrong <form> (2 forms on 1 page)
本文介绍了在<输入>上按Enter键提交错误的< form> (2页1页)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< form action =method =post onsubmit =ajax_send('<?print $ userid;?>',this.msg.value); return false;>
< input id =msgautocomplete =offtype =textname =msgstlye =width:80px; autofocus =autofocusplaceholder =在这里聊天/>
< input type =submit/>
< / form>
和
< form action =?page = about& id = 0#commentsmethod =post>
< input type =submitid =submit1name =submit1>< / div>< / div>
现在当我输入< input id =msg中的内容时。 。>
并按下回车键,它会提交第二个表单,而不是第一个表单。
我缺少什么?
解决方案
你好第二个表格不关闭我的朋友!
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?
解决方案
Youe second form isn't closed my friend!
这篇关于在<输入>上按Enter键提交错误的< form> (2页1页)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文