Ver Mensaje Individual
  #8 (permalink)  
Antiguo 31/07/2013, 18:16
metalgear2012xd
 
Fecha de Ingreso: mayo-2013
Mensajes: 11
Antigüedad: 10 años, 10 meses
Puntos: 0
Respuesta: como enviar 2 valores de 2 checkbox a un textbox

Cita:
Iniciado por bsanchez0323 Ver Mensaje
<form id="form1" method="post" action="">
<input name="checkbox" id="chk1" type="checkbox" onclick="hola()" value="1"/>
<input name="checkbox" id="chk2" type="checkbox" onclick="hola()" value="2"/>
<input type="week" name="status1" id="status1" maxlength="20"/>
</form>
<script type="text/javascript">

var checkboxes = document.getElementById("form1").checkbox;

function hola(){
var valores = '';
for (var x=0; x < checkboxes.length; x++) {
if (checkboxes[x].checked) {
valores += checkboxes[x].value;
}

}
document.getElementById("status1").value = valores;
}
</script>
Gracias , me funciono como queria , saludos