Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda