Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/06/2008, 21:47
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: document.form.control.value .. teniendo controles dinamicos?

Habría que ver cómo estás llamando a tu función (quizá los parámetros no tienen el tipo correcto). Lo siguiente, por ejemplo, funciona sin problemas:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title></title>
<
script>
function 
verificar(contador,nuevoValor){
    if(
document.getElementById('checkbox'+contador).checked){
        
document.getElementById('checkbox'+contador).value=nuevoValor;
    }
    
alert(document.getElementById('checkbox'+contador).value);
}
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <input type="checkbox" name="checkbox1" id="checkbox1" />
  <input type="checkbox" name="checkbox2" id="checkbox2" />
  <input type="checkbox" name="checkbox3" id="checkbox3" />
  <input type="button" name="a" value="verificar1" onclick="verificar(1,500)" /><input type="button" name="aa" value="verificar2" onclick="verificar(2,'hola')" /><input type="button" name="aaa" value="verificar3" onclick="verificar(3,'chau')" />
</form>
</body>
</html>