代码之家  ›  专栏  ›  技术社区  ›  MartinHN

ASP.NET自动提交只有一个文本框的表单

  •  0
  • MartinHN  · 技术社区  · 14 年前
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <input type="text" />
        </form>
    </body>
    </html>
    

    当我按Enter键时,当输入框有焦点时-表单提交。

    如果我 添加另一个未提交的输入框 . 只有一个输入框时,如何避免自动提交?

    1 回复  |  直到 14 年前
        1
  •  0
  •   Community CDub    7 年前

    在这里寻找答案 SO post

    高温高压