Ver Mensaje Individual
  #9 (permalink)  
Antiguo 29/06/2015, 07:19
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: For dentro de un select

estás seguro??

Cita:
<!DOCTYPE html>
<head>
<script type="text/javascript" >
var counter = 0;
var limit = 3;
function addInput(divName){
if (counter == limit) {
alert("Has llegado al límite" + counter + " inputs");
}
else {
<?php $opt =""; for( $i=1;$i<=31;$i++) { $opt.= "<option value='".$i."'>".$i."</option>"; } ?>
var newdiv = document.createElement('div');
newdiv.innerHTML = "Entry " + (counter + 1) + " <br><select name='dia[]' id='dia' title='dia' style='width:50px;'> <option value='0'>Día</option><?php echo $opt ?> </select>";
document.getElementById('sels').appendChild(newdiv );
counter++;
}
}
</script>
</head>
<body>

<input type="button" onclick="addInput()" />

<div id="sels"></div>
</body>
</html>
__________________
if(ViolenciaDeGénero) {alert('MUJER ASESINADA');}