自动提交 [英] Auto Submit

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

问题描述

我在LISTING 2中有一个组合,当用户

进行更改时,我正试图强制进行汇总。任何人都可以看到为什么它不会激活LISTING 2代码?

它只是没有做任何事情。我真正想要做的是在用户进行更改后访问组合的

值。我只是在这个例子中硬编码

teamID查询字符串。


上市1

------- ------

< script type = text / javascript>


function showTeams()

{

document.addForm.action =" ./ mypage.asp?teamID = 5" ;;

document.addForm.submit();

}

< / script>


上市2

------------
< form action =" mypage.asp"方法= QUOT;交" name =" addForm">


< select class =" FormTextBox" name =" cboCategory"

onchange =" javascript :showTeams();">


< OPTION value =" 1">工作时间表< / OPTION>

< OPTION value =" 2">会议< / OPTION>

< OPTION值=" 3"> Mills< / OPTION>

< OPTION value =" 5">团队< / OPTION>

< / select>

I have a combo in LISTING 2 that I''m trying to force a sumbit when a user
makes a change. Can anyone see why it doesn''t fire LISTING 2 code?
It just doesn''t do anything. What I''m really trying to do is access the
value of the combo after a user makes a change. I''m just hardcoding the
teamID querystring in this example.

LISTING 1
-------------
<script type=text/javascript>

function showTeams()
{
document.addForm.action = "./mypage.asp?teamID=5";
document.addForm.submit();
}
</script>

LISTING 2
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>

推荐答案

在IE中适合我。我建议,因为这是一个客户端问题,并且不是ASP,所以你在客户端组中进一步调查,例如

mpscripting.jscript 。


雷在家


" scott" < SB ***** @ mileslumber.com>在留言中写道

新闻:O2 ************** @ TK2MSFTNGP12.phx.gbl ...
Works fine for me in IE. I suggest, since this is a client-side issue and
not an ASP one, that you investigate further in a client-side group, such as
m.p.scripting.jscript.

Ray at home

"scott" <sb*****@mileslumber.com> wrote in message
news:O2**************@TK2MSFTNGP12.phx.gbl...
我有一个组合列表2当用户进行更改时,我正试图强制进行汇总。任何人都可以看到为什么它不会激活LISTING 2代码?
它只是没有做任何事情。我真正想要做的是在用户进行更改后访问组合的
值。我只是在这个例子中硬编码
teamID查询字符串。

上市1
-------------
< script type = text / javascript>

function showTeams()
{
document.addForm.action =" ./ mypage.asp?teamID = 5" ;;
document.addForm.submit();
}
< / script>

上市2
------------
< form action =" mypage.asp"方法= QUOT;交" name =" addForm">

< select class =" FormTextBox" name =" cboCategory"
onchange =" javascript :showTeams();">

< OPTION value =" 1">工作时间表< / OPTION>
< OPTION value =" 2">会议< / OPTION>
< OPTION value =" 3"> Mills< / OPTION>
< OPTION value =" 5">团队< / OPTION>
< / select>
I have a combo in LISTING 2 that I''m trying to force a sumbit when a user
makes a change. Can anyone see why it doesn''t fire LISTING 2 code?
It just doesn''t do anything. What I''m really trying to do is access the
value of the combo after a user makes a change. I''m just hardcoding the
teamID querystring in this example.

LISTING 1
-------------
<script type=text/javascript>

function showTeams()
{
document.addForm.action = "./mypage.asp?teamID=5";
document.addForm.submit();
}
</script>

LISTING 2
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>



适用于我。但是,我关闭了表格< / form> ;.


Bob Lehmann


" scott" < SB ***** @ mileslumber.com>在留言中写道

新闻:O2 ************** @ TK2MSFTNGP12.phx.gbl ...
Works for me. But, I closed the form </form>.

Bob Lehmann

"scott" <sb*****@mileslumber.com> wrote in message
news:O2**************@TK2MSFTNGP12.phx.gbl...
我有一个组合列表2当用户进行更改时,我正试图强制进行汇总。任何人都可以看到为什么它不会激活LISTING 2代码?
它只是没有做任何事情。我真正想要做的是在用户进行更改后访问组合的
值。我只是在这个例子中硬编码
teamID查询字符串。

上市1
-------------
< script type = text / javascript>

function showTeams()
{
document.addForm.action =" ./ mypage.asp?teamID = 5" ;;
document.addForm.submit();
}
< / script>

上市2
------------
< form action =" mypage.asp"方法= QUOT;交" name =" addForm">

< select class =" FormTextBox" name =" cboCategory"
onchange =" javascript :showTeams();">

< OPTION value =" 1">工作时间表< / OPTION>
< OPTION value =" 2">会议< / OPTION>
< OPTION value =" 3"> Mills< / OPTION>
< OPTION value =" 5"> Teams< / OPTION>
< / select>
I have a combo in LISTING 2 that I''m trying to force a sumbit when a user
makes a change. Can anyone see why it doesn''t fire LISTING 2 code?
It just doesn''t do anything. What I''m really trying to do is access the
value of the combo after a user makes a change. I''m just hardcoding the
teamID querystring in this example.

LISTING 1
-------------
<script type=text/javascript>

function showTeams()
{
document.addForm.action = "./mypage.asp?teamID=5";
document.addForm.submit();
}
</script>

LISTING 2
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>



OK guys ,我发现了真正的问题,因为我的简单提交的版本也为我工作了




在LISTING 2中的组合激发了Onchange事件的完美。但是,LISTING 3

不会触发我的ONCHANGE事件,因为我已经插入了一个隐藏的事件。

表格标签之后的字段。现在,如果我在表单内的任何地方都有隐藏的表单元素

标签,onchange就不会开火。


为什么隐藏?表单元素导致javascript onchange事件没有

工作?

列表1(工作)

---------- ---

< script type = text / javascript>


function showTeams()

{

document.addForm.action =" ./ mypage.asp?teamID = 5";

document.addForm.submit();

}

< / script>


上市2(工程)

------------
< form action =" mypage.asp"方法= QUOT;交" name =" addForm">


< select class =" FormTextBox" name =" cboCategory"

onchange =" javascript :showTeams();">


< OPTION value =" 1">工作时间表< / OPTION>

< OPTION value =" 2">会议< / OPTION>

< OPTION值=" 3"> Mills< / OPTION>

< OPTION value =" 5">团队< / OPTION>

< / select>

上市3(DOESN''TOT)

------------

< form action =" ; MyPage.asp并"方法= QUOT;交" name =" addForm">


< select class =" FormTextBox" name =" cboCategory"

onchange =" javascript :showTeams();">


< OPTION value =" 1">工作时间表< / OPTION>

< OPTION value =" 2">会议< / OPTION>

< OPTION值=" 3"> Mills< / OPTION>

< OPTION value =" 5">团队< / OPTION>

< / select>



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

新闻:Ox ************** @ TK2MSFTNGP12.phx.gbl ...
OK guys, I found the real problem because my simple submitted version worked
for me also.

IThe combo in LISTING 2 fires the Onchange event perfect. However, LISTING 3
will not fire my ONCHANGE event because I''ve inserted a "hidden" field after
the form tag. Now, if I have a hidden form element anywhere inside the form
tags, onchange won''t fire.

Why would a ''hidden'' form element cause a javascript onchange event to not
work?
LISTING 1 (WORKS)
-------------
<script type=text/javascript>

function showTeams()
{
document.addForm.action = "./mypage.asp?teamID=5";
document.addForm.submit();
}
</script>

LISTING 2 (WORKS)
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>
LISTING 3 (DOESN''T WORK)
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>


"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message
news:Ox**************@TK2MSFTNGP12.phx.gbl...
适合我。但是,我关闭了表格< / form> ;.

Bob Lehmann

scott < SB ***** @ mileslumber.com>在消息中写道
新闻:O2 ************** @ TK2MSFTNGP12.phx.gbl ...
Works for me. But, I closed the form </form>.

Bob Lehmann

"scott" <sb*****@mileslumber.com> wrote in message
news:O2**************@TK2MSFTNGP12.phx.gbl...
我在LISTING 2中有一个组合我当用户进行更改时,我试图强制进行汇总。任何人都可以看到为什么它不会激活LISTING 2代码?
它只是没有做任何事情。我真正想要做的是在用户进行更改后访问组合的
值。我只是在这个例子中硬编码
teamID查询字符串。

上市1
-------------
< script type = text / javascript>

function showTeams()
{
document.addForm.action =" ./ mypage.asp?teamID = 5" ;;
document.addForm.submit();
}
< / script>

上市2
------------
< form action =" mypage.asp"方法= QUOT;交" name =" addForm">

< select class =" FormTextBox" name =" cboCategory"
onchange =" javascript :showTeams();">

< OPTION value =" 1">工作时间表< / OPTION>
< OPTION value =" 2">会议< / OPTION>
< OPTION value =" 3"> Mills< / OPTION>
< OPTION value =" 5"> Teams< / OPTION>
< / select>
I have a combo in LISTING 2 that I''m trying to force a sumbit when a user
makes a change. Can anyone see why it doesn''t fire LISTING 2 code?
It just doesn''t do anything. What I''m really trying to do is access the
value of the combo after a user makes a change. I''m just hardcoding the
teamID querystring in this example.

LISTING 1
-------------
<script type=text/javascript>

function showTeams()
{
document.addForm.action = "./mypage.asp?teamID=5";
document.addForm.submit();
}
</script>

LISTING 2
------------
<form action="mypage.asp" method="post" name="addForm">

<select class="FormTextBox" name="cboCategory"
onchange="javascript:showTeams();">

<OPTION value="1">Work Schedule</OPTION>
<OPTION value="2">Meeting</OPTION>
<OPTION value="3">Mills</OPTION>
<OPTION value="5">Teams</OPTION>
</select>




这篇关于自动提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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