Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/11/2011, 07:54
elunicotomas
 
Fecha de Ingreso: octubre-2008
Mensajes: 13
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Codigo solo anda en iexplorer

ok lo deje asi y anda perfecto, pero solo en iexplorer!

HTML

Código PHP:
<form action="" method="post" name="inicio">

<
h1>eCard template </h1> <br /> 
Please choose if you want one of the pre-designed eCards or a personalized one <br /><br />
<
input name="myoption" type="radio" value="0" /> Pre-designed<br />
<
input name="myoption" type="radio" value="1" /> Personalized<br />
<
hr/>

<
class="centrar_boton"><input name="submit" type="button" value="Click to continue" onclick="validar(this.document.inicio)" /></p>

</
form
JS

Código PHP:
function validar(yo){

    var 
sel=false;
    for(var 
i=0;i<2;i++){
    if (
document.forms['inicio'].elements['myoption'][i].checked){
        
sel=true;
        break;
        }
    }
    if(
sel==false){
        
alert("You must choose an option!");
        return 
false
        
}
    
    if (
document.forms['inicio'].elements['myoption'][0].checked) {
        
location.href "predesigned.html";
}
    if (
document.forms['inicio'].elements['myoption'][1].checked) {
        
location.href "personalized.html";
}