即使选择了另一个,我的广播按钮仍在检查
工作colfusion/javaScript:我有一个由此循环创建的无线电按钮。
<cfloop from = '1' to = '#qxrefcnt#' index = 'k'>
<cfset selval = valls[k]>
<input type = 'radio'
class = 'moxradio round'
style = 'width:15px; height:15px; font-size:12px;
position:absolute; z-index:2"
name = 'selchoice'
id = 'top_k'
onclick = "topsplit('#k#','#selval#')">
<a style = 'padding-left: 50px'> #displs[k]#</a><br>
</cfloop>
当单击一个按钮时,这些列表会下降:
function toggscr(id){
var thelist = document.getElementById(id);
if(thelist.style.display == 'none'){
thelist.style.display = '';
}
else if(thelist.style.display != 'none'){
thelist.style.display = 'none';}
}//end toggscr
当我从无线电列表中选择一个项目时,我的程序可以使用正确的操作,并且按照正常的叶子检查按钮。
function topsplit(k,valls) {
var val = valls.split("~");
for (j = 0; j< val.length; j++) {
m = j+1;
colid = 'x_'+ m;
var x = document.getElementById(colid);
//enter value into form
document.getElementById(colid).value = val[j];
}//for
document.getElementById('sel').style.display = 'none';
//the lines below do not uncheck anything
var radid = 'top_' + k;
document.getElementById(radid).checked = 'false';
}//endfunction topsplit
如果我去检查另一个按钮,该程序再次执行正确的操作,,但原始按钮也仍在检查(如果单击时将不再工作)。
我不知道这里是错误的。我所有的其他广播按钮都可以正常工作。如果有人知道问题是什么,我很高兴听到它。
Working Colfusion/javascript: I have a set of radio buttons created by this loop.
<cfloop from = '1' to = '#qxrefcnt#' index = 'k'>
<cfset selval = valls[k]>
<input type = 'radio'
class = 'moxradio round'
style = 'width:15px; height:15px; font-size:12px;
position:absolute; z-index:2"
name = 'selchoice'
id = 'top_k'
onclick = "topsplit('#k#','#selval#')">
<a style = 'padding-left: 50px'> #displs[k]#</a><br>
</cfloop>
These list drops down when a button is clicked:
function toggscr(id){
var thelist = document.getElementById(id);
if(thelist.style.display == 'none'){
thelist.style.display = '';
}
else if(thelist.style.display != 'none'){
thelist.style.display = 'none';}
}//end toggscr
When I select an item from the radio list, my program does the correct thing with it, and as is normal leaves that button checked.
function topsplit(k,valls) {
var val = valls.split("~");
for (j = 0; j< val.length; j++) {
m = j+1;
colid = 'x_'+ m;
var x = document.getElementById(colid);
//enter value into form
document.getElementById(colid).value = val[j];
}//for
document.getElementById('sel').style.display = 'none';
//the lines below do not uncheck anything
var radid = 'top_' + k;
document.getElementById(radid).checked = 'false';
}//endfunction topsplit
If I then go check another button, the program again does the right thing, but the original button also remains checked, (and will not work again if clicked).
Here is a picture of the multiply checked radio list:
I can't figure out is wrong here. All my other radio buttons are working properly. If anyone has an idea what the problem is, I'd be glad to hear it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论