输入密钥以提交表单

问题描述:

您好,


我想知道如何让enter键提交表单。我在另一个新闻组中读到
,插入一个html隐藏文本框制作了

技巧,实际上它确实如此,但在我的页面中我有多个web控件

具有独立的表格 (在.NET环境中,它只需要一个)b $ b。我需要这样,如果用户是,比如写一个关键字

来执行搜索,则输入密钥会提交此表单,但如果他正在编写

他的用户名和密码登录,回车键提交另一个

一个........


有谁知道怎么做?


SC

Hello,

I want to know what I have to do to make the enter key to submit forms. I
read in another newsgroup that inserting an html hidden text box made the
trick, and it actually does, but in my page I have more than one web control
that have their independient "forms" (in the .NET environment, it makes it
to be just one). And I need that, if the user is, say, writing the keywords
to perform a search, the enter key submits this form, but if he is writing
his username and password to login, the enter key submits this other
one........

Does anyone know how to do this?

Best Regards,

SC

Sandra,


我用

创建了一个javascript组件和一些常用的javascripts。其中一个完全符合您的要求。


组件是免费的,附带帮助文件,整个项目

源代码可用在我的网站上: www.aboutfortunate.com 。只需在代码库链接上单击

,然后单击Javascript即可。按钮在左边的

菜单中。


即使你不想使用整个组件你需要的代码

创建自己的项目。


-

此致,


S. Justin Gengo,MCP

Web开发人员/程序员


免费代码库位于:
www.aboutfortunate.com


混乱无序。

Nietzche

" Sandra Castellanos" < SA ***** @ 4brainstorm.com>在消息中写道

news:uX ************** @ TK2MSFTNGP12.phx.gbl ...
Sandra,

I''ve created a javascript component with some commonly used javascripts in
it. One of them does exactly what you are looking for.

The component is free, comes with a help file, and the entire projects
source code is available on my web site: www.aboutfortunate.com. Just click
on the code library link and then click on the "Javascript" button in the
menu on the left.

Even if you don''t want to use the entire component the code you need to
create your own is in the project.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Sandra Castellanos" <sa*****@4brainstorm.com> wrote in message
news:uX**************@TK2MSFTNGP12.phx.gbl...
你好,>
我想知道如何使用enter键提交表单。我在另一个新闻组中读到,插入一个html隐藏文本框制作了
技巧,实际上它确实如此,但在我的页面中我有多个web
控件,它们具有独立的形式&QUOT; (在.NET环境中,它只是一个)。我需要这样,如果用户在编写
关键字来执行搜索,则输入密钥会提交此表单,但如果他正在写入用户名和密码登录,则输入密钥提交另一个
一个........

有谁知道怎么做?

最诚挚的问候,
> SC
Hello,

I want to know what I have to do to make the enter key to submit forms. I
read in another newsgroup that inserting an html hidden text box made the
trick, and it actually does, but in my page I have more than one web control that have their independient "forms" (in the .NET environment, it makes it
to be just one). And I need that, if the user is, say, writing the keywords to perform a search, the enter key submits this form, but if he is writing
his username and password to login, the enter key submits this other
one........

Does anyone know how to do this?

Best Regards,

SC






非常感谢您的代码,但我仍然有一个问题,那就是.NET是构建表单的那个,它总是给它起名称

的页面,例如页面是Default.aspx,表格名称

将是FormDefault。这些形式我有Web控件,并且它们包含在许多不同的页面中。所以我不能使用像

这样的表格的名称....有没有像document.forms(0).thebutton?


再次感谢再见


SC

" S. Justin Gengo &LT; SJ ***** @ aboutfortunate.com&GT;在消息中写道

新闻:eV ************* @tk2msftngp13.phx.gbl ...
Hi,

Thank you very much for the code, but I still have one problem, and it is
that .NET is the one that builds the form, and it always gives it the name
of the page, for example if the page is Default.aspx, the name of the form
will be FormDefault. These "forms" I have are in web controls, and they are
included in many different pages. So I can''t use the name of the form like
that.... Is there anything like document.forms(0).thebutton?

Thanks again and bye

SC
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:eV*************@tk2msftngp13.phx.gbl...
Sandra,

我已经创建了一个javascript组件,其中包含一些常用的javascripts。其中一个完全符合您的要求。

该组件是免费的,附带一个帮助文件,整个项目源代码可以在我的网站上找到: www.aboutfortunate.com 。只需
点击代码库链接,然后点击Javascript即可。左侧
菜单中的按钮。

即使您不想使用整个组件,您需要创建自己的代码才能在项目中使用。

-
真诚的,

S. Justin Gengo,MCP
Web开发人员/程序员

免费代码库:
www.aboutfortunate.com

"出于混乱而来的是订单。
Nietzche

" Sandra Castellanos" &LT; SA ***** @ 4brainstorm.com&GT;在消息中写道
新闻:uX ************** @ TK2MSFTNGP12.phx.gbl ...
Sandra,

I''ve created a javascript component with some commonly used javascripts in
it. One of them does exactly what you are looking for.

The component is free, comes with a help file, and the entire projects
source code is available on my web site: www.aboutfortunate.com. Just click on the code library link and then click on the "Javascript" button in the
menu on the left.

Even if you don''t want to use the entire component the code you need to
create your own is in the project.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Sandra Castellanos" <sa*****@4brainstorm.com> wrote in message
news:uX**************@TK2MSFTNGP12.phx.gbl...
你好,
>我想知道如何使用enter键提交表单。
我在另一个新闻组中读到,插入一个html隐藏文本框使
成为伎俩,实际上它确实如此,但在我的页面中我有多个web
Hello,

I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my page I have more than one web


control


control

具有独立的形式 (在.NET环境中,它使
成为一个)。我需要的是,如果用户在编写
that have their independient "forms" (in the .NET environment, it makes it to be just one). And I need that, if the user is, say, writing the


关键字

来执行搜索,则输入密钥会提交此表单,但如果他是
写他的用户名和密码登录,输入键提交另一个........

有谁知道怎么做?


SC
to perform a search, the enter key submits this form, but if he is writing his username and password to login, the enter key submits this other
one........

Does anyone know how to do this?

Best Regards,

SC




对不起,请忽略以前的消息,我只是愚蠢。


SC

" S。 Justin Gengo &LT; SJ ***** @ aboutfortunate.com&GT;在消息中写道

新闻:eV ************* @tk2msftngp13.phx.gbl ...
Sorry, ignore the previous message, I was just being stupid.

SC
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:eV*************@tk2msftngp13.phx.gbl...
Sandra,

我已经创建了一个javascript组件,其中包含一些常用的javascripts。其中一个完全符合您的要求。

该组件是免费的,附带一个帮助文件,整个项目源代码可以在我的网站上找到: www.aboutfortunate.com 。只需
点击代码库链接,然后点击Javascript即可。左侧
菜单中的按钮。

即使您不想使用整个组件,您需要创建自己的代码才能在项目中使用。

-
真诚的,

S. Justin Gengo,MCP
Web开发人员/程序员

免费代码库:
www.aboutfortunate.com

"出于混乱而来的是订单。
Nietzche

" Sandra Castellanos" &LT; SA ***** @ 4brainstorm.com&GT;在消息中写道
新闻:uX ************** @ TK2MSFTNGP12.phx.gbl ...
Sandra,

I''ve created a javascript component with some commonly used javascripts in
it. One of them does exactly what you are looking for.

The component is free, comes with a help file, and the entire projects
source code is available on my web site: www.aboutfortunate.com. Just click on the code library link and then click on the "Javascript" button in the
menu on the left.

Even if you don''t want to use the entire component the code you need to
create your own is in the project.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Sandra Castellanos" <sa*****@4brainstorm.com> wrote in message
news:uX**************@TK2MSFTNGP12.phx.gbl...
你好,
>我想知道如何使用enter键提交表单。
我在另一个新闻组中读到,插入一个html隐藏文本框使
成为伎俩,实际上它确实如此,但在我的页面中我有多个web
Hello,

I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my page I have more than one web


control


control

具有独立的形式 (在.NET环境中,它使
成为一个)。我需要的是,如果用户在编写
that have their independient "forms" (in the .NET environment, it makes it to be just one). And I need that, if the user is, say, writing the


关键字

来执行搜索,则输入密钥会提交此表单,但如果他是
写他的用户名和密码登录,输入键提交另一个........

有谁知道怎么做?


SC
to perform a search, the enter key submits this form, but if he is writing his username and password to login, the enter key submits this other
one........

Does anyone know how to do this?

Best Regards,

SC