Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/08/2007, 12:07
Gonzandu
 
Fecha de Ingreso: noviembre-2006
Mensajes: 8
Antigüedad: 18 años, 3 meses
Puntos: 0
Problema al cojer value de un input radio

Hola chicos,

tengo el siguiente código:

Código:
<script>
function conectar(){
    if (window.XMLHttpRequest){
        return new XMLHttpRequest()
    }else if (window.ActiveXObject){
        return new ActiveXObject("Microsoft.XMLHTTP")
    }
    return false;
}

function buscar_datos(){
    xmlhttp = conectar();
    xmlhttp.open("POST", "buscador_ajax.php", true);
    xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==1) {
            document.getElementById('mostrando').innerHTML = '<br/><br/><br/><img src="images/misc/ajax_loading.gif" /><br/><br/>Enviando datos....';
        }
        if (xmlhttp.readyState==2) {
            document.getElementById('mostrando').innerHTML = '<br/><br/><br/><img src="images/misc/ajax_loading.gif" /><br/><br/>Cargando....';
        }
        if (xmlhttp.readyState==4) {
            document.getElementById('mostrando').innerHTML = xmlhttp.responseText;
        }
    }
    
    xmlhttp.send("ciudad=" + document.getElementById('en_ciudad').value + "&inmueble=" + document.getElementById('inmueble').value);
    return false;

}
</script>
y por otra parte

Código:
<form name="formulario" id="formulario" action="" method="POST" enctype="multipart/form-data" onsubmit="return buscar_datos()">
                
                <div class="opcion_claim">
                
                <h5>&iquest;el qu&eacute;?</h5>
                
                    <input id="inmueble" name="inmueble1" type="radio" onclick="inmo('0','que');" value="hola1" /><label>hola1</label><br />
                    <input id="inmueble" name="inmueble2" type="radio" onclick="inmo('1','que');" value="hola2" /><label>hola2</label><br />
                    <input id="inmueble" name="inmueble3" type="radio" onclick="inmo('2','que');" value="hola3" /><label>hola3</label><br />
                    <input id="inmueble" name="inmueble4" type="radio" onclick="inmo('3','que');" value="hola4" /><label>hola4</label><br />

                </div>
</form>
Y el problema es al seleccionar el input radio del que quiero pasarle el value, al tener todos el id="inmueble" siempre me coge el primero y aparte, me deja seleccionar varios input radio a la vez.

¿Alguna solución?

Gracias : )