Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
my radio buttons are staying checked even when another is selected

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!