Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/07/2013, 17:04
bsanchez0323
 
Fecha de Ingreso: julio-2013
Mensajes: 32
Antigüedad: 10 años, 8 meses
Puntos: 2
Respuesta: como enviar 2 valores de 2 checkbox a un textbox

<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>

Última edición por bsanchez0323; 31/07/2013 a las 17:29