即使选择了另一个,我的广播按钮仍在检查

发布于 2025-02-11 06:36:19 字数 1789 浏览 1 评论 0原文

工作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:
enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文