复选框 [英] check boxes again
问题描述
以不同的方式再次尝试这个问题并将其扩展到另一个新闻组。
另一个新闻组。寻找我将如何做到这一点。
对于html表单;
假设我有三个复选框A,B和C.当我点击一个复选框时,
下拉窗口将在它旁边打开,选项将是1,2,
和3.我想使用相同的脚本和每个3
复选框的下拉列表,并且能够相互独立地返回值。
如果我勾选方框A然后选择2它将返回A和2 for
复选框A.然后转到BI可以检查B并选择1,返回B
和1.我希望能够做到这一点,或者所有的
复选框,但我只想要显示下拉菜单,如果该框是
选中。这有任何意义吗?指针,链接或示例脚本
赞赏。
再次感谢您的投入。
-
Patrick A. Smith助理系统管理员
海洋流通集团?南佛罗里达大学 - 海洋科学学院
http://ocgweb.marine.usf.edu
第一次做正确事情的麻烦在于,没有人会赞赏它是多么困难。 - La Rochefoucauld
Patrick写道:
再次尝试这个问题方式并将其扩展到
另一个新闻组。寻找我将如何做到这一点。
通常人们希望看到你的努力。
>
对于html表单;
说我有三个复选框A ,B和C.当我点击一个复选框
那将是onclick;
< input type ="复选框" onclick =" doSomeJavascriptFunction(this)">
a
下拉窗口将在其旁边打开
可以显示:无
函数doSomeJavascriptFunction(obj){
if( obj.checked){
reference_to_rolldown.style.display =''block'';
} else {
reference_to_rolldown.style.display = ''没有';
}
}
对rolldown的引用可能是:
document.getElementById(''id_of_hidden_rolldown'')
,选项将为1,2,
和3.我想为3
复选框中的每一个使用相同的脚本和下拉列表,并且能够相互独立地返回值。
如果我勾选方框A然后选择2则意味着它将返回A和2以获取
复选框A.然后转到BI c检查B并选择1,返回B
和1.我希望能够为两个或所有
复选框执行此操作,但我只想要如果选中该框,则显示下拉菜单。这有任何意义吗?
No.
Jeff
指针,链接或示例脚本
赞赏。
再次感谢您的投入。
Jeff写道:
Patrick写道:
>再次尝试这个问题以不同的方式将其扩展到另一个新闻组。寻找我将如何做到这一点。
通常人们希望看到你的努力。
>>
对于html表单;
说我有三个复选框A,B和C.当我点击一个复选框
那将是onclick;
< input type ="复选框" onclick =" doSomeJavascriptFunction(this)">
a
>下拉窗口将在其旁边打开
可以显示:无
函数doSomeJavascriptFunction(obj){
if(obj.checked){
reference_to_rolldown.style.display =''block'';
} else {
reference_to_rolldown.style。 display =''none'';
}
}
对rolldown的引用可能是:
document.getElementById(''id_of_hidden_rolldown'')
和选项将是1,2,
>和3.我想为每个3
复选框使用相同的脚本和下拉列表,并且能够相互独立地返回值。
含义如果我勾选方框A,然后选择2,它将返回A和2,用于
复选框A.然后继续选择BI可以检查B并选择1,返回
B和1.我希望能够为两个或所有
复选框执行此操作,但我只想在框中显示下拉列表检查。这有任何意义吗?
No.
Jeff
指针,链接或示例脚本
>赞赏。
再次感谢您的投入。
杰夫,
我努力展示。它在下面的链接。我有一些你写的b
。也许你将能够更好地理解
我不明白的问题。请记住,链接是粗略的页面
并没有全部整理等等,并且提交已被禁用。
http://ocgweb.marine.usf.edu/Orbgps/chbox_exmp.php
< br $>
-
Patrick
去公牛队!
11月18,8:40 * pm,Patrick写道:
再次尝试这个问题方式并将其扩展到
另一个新闻组。寻找我将如何做到这一点。 *
查看CPAN的CGI :: Ajax Perl模块。
它带有例子,也许你可以使用
,
http:// search.cpan [。] org / src / BPEDERSE / CGI-Ajax-0.707 / scripts /
(从URL中删除方括号)。
Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
For an html form;
Say I have three check boxes A, B, and C . When I click on a checkbox a
dropdown window will open next to it and the selections will be 1, 2,
and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense? Pointers, links or example scripts
appreciated.
Thanks again so much for your input.
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group ? USF - College of Marine Science
http://ocgweb.marine.usf.edu
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
Patrick wrote:Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.Usually people want to see some effort on your part.
>
For an html form;
Say I have three check boxes A, B, and C . When I click on a checkboxThat would be onclick;
<input type="checkbox" onclick="doSomeJavascriptFunction(this)">
adropdown window will open next to itCould be display: none
function doSomeJavascriptFunction(obj){
if(obj.checked){
reference_to_rolldown.style.display = ''block'';
}else{
reference_to_rolldown.style.display = ''none'';
}
}
where reference to rolldown might be:
document.getElementById(''id_of_hidden_rolldown'')
and the selections will be 1, 2,and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning B
and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense?No.
Jeff
Pointers, links or example scriptsappreciated.
Thanks again so much for your input.
Jeff wrote:Patrick wrote:>Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this.
Usually people want to see some effort on your part.>>
For an html form;
Say I have three check boxes A, B, and C . When I click on a checkbox
That would be onclick;
<input type="checkbox" onclick="doSomeJavascriptFunction(this)">
a>dropdown window will open next to it
Could be display: none
function doSomeJavascriptFunction(obj){
if(obj.checked){
reference_to_rolldown.style.display = ''block'';
}else{
reference_to_rolldown.style.display = ''none'';
}
}
where reference to rolldown might be:
document.getElementById(''id_of_hidden_rolldown'')
and the selections will be 1, 2,>and 3. I want to use the same script and dropdown for each of the 3
check boxes and be able to return values independent of each other.
Meaning if I check box A and then select 2 it will return A and 2 for
checkbox A. Then moving on to B I can check B and select 1, returning
B and 1. I want to be able to do this for one two, or all of the
checkboxes, but I only want the dropdowns displayed if the box is
checked. Does that make any sense?
No.
Jeff
Pointers, links or example scripts>appreciated.
Thanks again so much for your input.
Jeff,
I have effort to show. It is at the link below. I have some of what you
have written. Perhaps you will be able to better understand the part of
my question you didn''t understand. Remember, the link is to a rough page
and is not all tidied up, etc. and submit has been disabled.
http://ocgweb.marine.usf.edu/Orbgps/chbox_exmp.php
--
Patrick
Go Bulls!
On Nov 18, 8:40*pm, Patrick wrote:Trying this question again in a different way and expanding it to
another newsgroup. Looking for how I would do this. *
Have a look at the CGI::Ajax Perl module from CPAN.
It comes with examples, maybe there is something
you could use,
http://search.cpan[.]org/src/BPEDERSE/CGI-Ajax-0.707/scripts/
(remove the square brackets from the URL).
这篇关于复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!