Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/06/2009, 11:17
andresito12_19
 
Fecha de Ingreso: noviembre-2008
Mensajes: 80
Antigüedad: 17 años, 11 meses
Puntos: 1
Respuesta: problema con input radio

Cita:
Iniciado por David el Grande Ver Mensaje
¿Qué tienes en la función enviarFormulario()?
esta es la funcion enviarFormulario que se utiliza debido al a utilizacion de div
Código PHP:
function enviarFormulario(url, formid){
    var  
peticion = false
if (window.XMLHttpRequest) {// Si es Mozilla, Safari etc
 
peticion = new XMLHttpRequest()
} else if (
window.ActiveXObject){ // pero si es IE
try {
 
peticion = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (
e){ // en caso que sea una versión antigua
try{
 
peticion = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (
e){}
}
}
         var 
Formulario = document.getElementById(formid);
         var 
cadenaFormulario = "";
         var 
sepCampos;
         
sepCampos = "";
         for (var 
i=0; i <= Formulario.elements.length-1;i++) {
         
cadenaFormulario += sepCampos+Formulario.elements[i].name+'='+encodeURI(Formulario.elements[i].value);
         
sepCampos="&";
}
  
peticion.open("POST", url, true);
  
peticion.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1');
  
peticion.onreadystatechange = function () {
  if (
peticion.readyState == 4 && (peticion.status == 200 || window.location.href.indexOf ("http") == - 1)){
                
document.getElementById('contenedor').innerHTML = peticion.responseText;
          } 
}
peticion.send(cadenaFormulario);
}