输入密钥不会提交表单 [英] Enter key will not submit the form

查看:55
本文介绍了输入密钥不会提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我想提交给自己的表格。我希望能够输入一个

的数字列表并提交表格,并将该列表显示在我键入的文本框下的相同

表格中和按钮。问题是

当我向自己发布一个表单时,Enter键不会提交表单,它只会清除文本框中的内容。我提交的唯一方法是

点击提交按钮。这是我的代码的简化版本,我有

注释掉,所以你可以看到源代码。请注意页面的名称是

Page1.asp


''<%@ Language = VBScript%>

''< HTML>

''< HEAD>

''< / HEAD>

''< BODY>

''< p>输入用逗号分隔的数字。< / p>

''< form action =" Page1.asp"方法= QUOT; POST" id = form1 name = form1>

''< p>< input type =" text"名称= QUOT; ListID"大小= QUOT; 50" maxlength =" 1000">< / p>

''< p>< input type =" submit"值= [提交" name =" B1">< input type =" reset"

value =" Reset" ''name =" B2">< / p>

''< / form>

''<%if Request.Form(") B1")= [提交"然后

''lvListID = Request.Form(" ListID")

''Response.Write lvListID

''End IF'' %>

''< / BODY>

''< / HTML>


我知道我''我之前发过一个页面,从来没有遇到过问题

输入密钥没有提交。我做错了什么?

谢谢

Mike

I have a form I want to submit to itself. I want to be able to type in a
list of numbers and submit the form and have that list show up on the same
form under the text box I typed them into and the buttons. The problem is
when I post a form to itself, the Enter key will not submit the form, it
only clears the contents of the text box. The only way I can submit is to
click the submit button. Here is a simplified version of my code that I had
to comment out so you could see the source. Note the name of the page is
Page1.asp

''<%@ Language=VBScript %>
''<HTML>
''<HEAD>
''</HEAD>
''<BODY>
''<p>Enter numbers separated by a comma.</p>
''<form action="Page1.asp" method="POST" id=form1 name=form1>
''<p><input type="text" name="ListID" size="50" maxlength="1000"></p>
''<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" ''name="B2"></p>
''</form>
''<%if Request.Form("B1")="Submit" then
'' lvListID=Request.Form("ListID")
'' Response.Write lvListID
''End IF ''%>
''</BODY>
''</HTML>

I know I''ve posted a page to itself before and had never had problems with
the Enter key not submitting. What am I doing wrong?
Thanks
Mike

推荐答案

很可能是提交正好。您只是没有使用正确的

标准来确定它是否已提交。尝试根据Request.Form(ListID)或

Request.ServerVariables(REQUEST_METHOD)的内容评估您的IF

语句。要确认您的表单是否为
提交,请尝试使用此代码并按Enter:


< HTML>

< HEAD>

< / HEAD>

< BODY>

< p>输入以逗号分隔的数字。< / p> ;

< form action =" page1.asp"方法= QUOT; POST" id = form1 name = form1>

< p>< input type =" text"名称= QUOT; ListID"大小= QUOT; 50" maxlength =" 1000">< / p>

< p>< input type =" submit"值= [提交" name =" B1">< input type =" reset"

value =" Reset" name =" B2">< / p>

< / form>

<%


For Request.Form中的每一件事

Response.Write thing& " = &安培; Request.Form(thing)& "< hr />"

下一页


%>

< / BODY>

< / HTML>


Ray在工作


" M Smith" < MS **** @ avma.org>在留言中写道

新闻:e9 ************** @ TK2MSFTNGP12.phx.gbl ...
It most likely is submitting just fine. You''re just not using the correct
criteria to determine if it was submitted. Try either evaluating your IF
statement based on the contents of Request.Form("ListID") or
Request.ServerVariables("REQUEST_METHOD"). To verify that your form is
submitting, try using this code and pressing enter:

<HTML>
<HEAD>
</HEAD>
<BODY>
<p>Enter numbers separated by a comma.</p>
<form action="page1.asp" method="POST" id=form1 name=form1>
<p><input type="text" name="ListID" size="50" maxlength="1000"></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>
<%

For Each thing in Request.Form
Response.Write thing & " = " & Request.Form(thing) & "<hr />"
Next

%>
</BODY>
</HTML>

Ray at work

"M Smith" <ms****@avma.org> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
我有一个表格我想要屈服于自己。我希望能够输入一个数字列表并提交表格,并将该列表显示在我输入的文本框和按钮下的相同表格中。问题是当我将表单发布到自身时,Enter键不会提交表单,它只会清除文本框的内容。我提交的唯一方法是点击提交按钮。这是我的代码的简化版本,我b $ b必须注释掉,以便您可以看到源代码。请注意页面的名称是
Page 1.asp

''<%@ Language = VBScript%>
''< HTML>
'' < HEAD>
''< / HEAD>
''< BODY>
''< p>输入以逗号分隔的数字。< / p>
''< form action =" Page1.asp"方法= QUOT; POST" id = form1 name = form1>
''< p>< input type =" text"名称= QUOT; ListID"大小= QUOT; 50" maxlength =" 1000">< / p>
''< p>< input type =" submit"值= [提交" name =" B1">< input type =" reset"
value ="重置" ''name =" B2">< / p>
''< / form>
''<%if if Request.Form(" B1")=" Submit"然后
''lvListID = Request.Form(" ListID")
''Response.Write lvListID
''结束IF''%>
''< / BODY>
''< / HTML>

我知道我之前已经发布了一个页面,并且从未遇到过输入密钥未提交的问题。我做错了什么?
谢谢
Mike
I have a form I want to submit to itself. I want to be able to type in a
list of numbers and submit the form and have that list show up on the same
form under the text box I typed them into and the buttons. The problem is
when I post a form to itself, the Enter key will not submit the form, it
only clears the contents of the text box. The only way I can submit is to
click the submit button. Here is a simplified version of my code that I had to comment out so you could see the source. Note the name of the page is
Page1.asp

''<%@ Language=VBScript %>
''<HTML>
''<HEAD>
''</HEAD>
''<BODY>
''<p>Enter numbers separated by a comma.</p>
''<form action="Page1.asp" method="POST" id=form1 name=form1>
''<p><input type="text" name="ListID" size="50" maxlength="1000"></p>
''<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" ''name="B2"></p>
''</form>
''<%if Request.Form("B1")="Submit" then
'' lvListID=Request.Form("ListID")
'' Response.Write lvListID
''End IF ''%>
''</BODY>
''</HTML>

I know I''ve posted a page to itself before and had never had problems with
the Enter key not submitting. What am I doing wrong?
Thanks
Mike



这是IE中的一个错误(想象一下) 。当只有一个文本框时,IE会搞砸




我不记得解决方法了(有趣的是IE现在是浏览器工作

左右),但我想如果你添加一个隐藏的字段,或者隐藏

visibilty的文本框,它将起作用。


Bob Lehmann


" M Smith" < MS **** @ avma.org>在留言中写道

新闻:e9 ************** @ TK2MSFTNGP12.phx.gbl ...
It''s a bug in IE (imagine that). When there is only one text box, IE messes
it up.

I don''t remember the work-around (funny that IE is now the browser to work
around), but I think if you add a hidden field, or a text box with the
visibilty hidden it will work.

Bob Lehmann

"M Smith" <ms****@avma.org> wrote in message
news:e9**************@TK2MSFTNGP12.phx.gbl...
我有一个表格我想要屈服于自己。我希望能够输入一个数字列表并提交表格,并将该列表显示在我输入的文本框和按钮下的相同表格中。问题是当我将表单发布到自身时,Enter键不会提交表单,它只会清除文本框的内容。我提交的唯一方法是点击提交按钮。这是我的代码的简化版本,我b $ b必须注释掉,以便您可以看到源代码。请注意页面的名称是
Page 1.asp

''<%@ Language = VBScript%>
''< HTML>
'' < HEAD>
''< / HEAD>
''< BODY>
''< p>输入以逗号分隔的数字。< / p>
''< form action =" Page1.asp"方法= QUOT; POST" id = form1 name = form1>
''< p>< input type =" text"名称= QUOT; ListID"大小= QUOT; 50" maxlength =" 1000">< / p>
''< p>< input type =" submit"值= [提交" name =" B1">< input type =" reset"
value ="重置" ''name =" B2">< / p>
''< / form>
''<%if if Request.Form(" B1")=" Submit"然后
''lvListID = Request.Form(" ListID")
''Response.Write lvListID
''结束IF''%>
''< / BODY>
''< / HTML>

我知道我之前已经发布了一个页面,并且从未遇到过输入密钥未提交的问题。我做错了什么?
谢谢
Mike
I have a form I want to submit to itself. I want to be able to type in a
list of numbers and submit the form and have that list show up on the same
form under the text box I typed them into and the buttons. The problem is
when I post a form to itself, the Enter key will not submit the form, it
only clears the contents of the text box. The only way I can submit is to
click the submit button. Here is a simplified version of my code that I had to comment out so you could see the source. Note the name of the page is
Page1.asp

''<%@ Language=VBScript %>
''<HTML>
''<HEAD>
''</HEAD>
''<BODY>
''<p>Enter numbers separated by a comma.</p>
''<form action="Page1.asp" method="POST" id=form1 name=form1>
''<p><input type="text" name="ListID" size="50" maxlength="1000"></p>
''<p><input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" ''name="B2"></p>
''</form>
''<%if Request.Form("B1")="Submit" then
'' lvListID=Request.Form("ListID")
'' Response.Write lvListID
''End IF ''%>
''</BODY>
''</HTML>

I know I''ve posted a page to itself before and had never had problems with
the Enter key not submitting. What am I doing wrong?
Thanks
Mike



使用IE工作得很好。


雷在工作


Bob Lehmann <无**** @ dontbotherme.zzz>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP15.phx.gbl ...
Worked fine for me using IE.

Ray at work

"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
它' IE中的一个错误(想象一下)。当只有一个文本框时,IE
会让它变得混乱。

我不记得解决方法(有趣的是IE现在是浏览器工作的
),但我想如果你添加一个隐藏的字段,或隐藏
visibilty的文本框,它将起作用。

Bob Lehmann
It''s a bug in IE (imagine that). When there is only one text box, IE messes it up.

I don''t remember the work-around (funny that IE is now the browser to work
around), but I think if you add a hidden field, or a text box with the
visibilty hidden it will work.

Bob Lehmann



这篇关于输入密钥不会提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆