为什么只有一个文本框的html表单在使用jquery点击enter键后被提交,但如果有两个文本框则不被提交?

为什么只有一个文本框的html表单在使用jquery点击enter键后被提交,但如果有两个文本框则不被提交?,jquery,html,forms,jquery-ui,submit,Jquery,Html,Forms,Jquery Ui,Submit,两个表单都没有提交按钮。 表格A有两个文本框,表格B只有一个。我的问题是:“为什么在点击回车键时,表格A不提交,而表格B提交?”。 实际上我不想提交表格 表格A <button type="button" id="login-btn">LOG IN</button> <button type="button" id="logout-btn">LOG OUT</button> <div id="div_login_dialog" style=

两个表单都没有提交按钮。 表格A有两个文本框,表格B只有一个。我的问题是:“为什么在点击回车键时,表格A不提交,而表格B提交?”。 实际上我不想提交表格

表格A

<button type="button" id="login-btn">LOG IN</button>
<button type="button" id="logout-btn">LOG OUT</button>

<div id="div_login_dialog" style="display: none;">
    <form id="form_login_dialog">
        <table>
            <tr>
                <td>
                    <p><label>How many Picklists?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="login-picklist">
                </td>
            </tr>
            <tr>
                <td>
                    <p><label>How many Items?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="login-item">
                </td>
            </tr>
        </table>
    </form>
</div>

@blgt it表示“我听说这个问题是IE的问题,而不是FireFox或其他浏览器的问题。虽然它似乎也会影响到他们”,但对其他浏览器的评论也证实了其他浏览器中也存在这种行为,链接的答案实际上指向。。。这应该可以解释这种行为并澄清OP的疑问。我承认,在live.com链接之后,我停止阅读第二个答案。将我链接的问题标记为该问题的副本(因为它具有相同的规范链接)可能是一个好主意,因为没有提交按钮可能会在表单中出现一些问题,特别是当您希望稍后通过JS提交时。另外,您正在同一元素上使用2次单击处理程序-您可能希望使用名称空间。只是旁注。
<div id="div_logout_dialog" style="display: none;">
    <form id="form_logout_dialog">
        <table>
            <tr>
                <td>
                    <p><label>How many items didn't picked?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="logout-item">
                </td>
            </tr>
        </table>
    </form>
</div>
$("#login-btn").click(function() {
        $("#div_login_dialog").dialog("open");
    });
    $("#logout-btn").click(function() {
        $("#div_logout_dialog").dialog("open");
    });