Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/12/2008, 07:48
Avatar de ACX_POISON
ACX_POISON
 
Fecha de Ingreso: abril-2008
Ubicación: Talca-Chile
Mensajes: 750
Antigüedad: 16 años, 11 meses
Puntos: 7
Pregunta ayuda con radio button

Gracias X leerlo

amigos tengo un problema y necesito su ayuda

resulta que intento hacer una especie de formulario dinamico que al seleccionar
- contado
-cheque
-cuota
con unos radiobutton me cargue en un espacio asignado las opciones relacionadas con la seleccion creo no tener problema en hacerlo salvo en que el radio buton nunca cambia de valor y me muestra siembre las opcion contado :

aqui dejo el codigo para que me digan que estoy haciendo mal...

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Forma de Pago</title>
<
style type="text/css">
<!--
#Layer1 {
    
position:absolute;
    
width:457px;
    
height:115px;
    
z-index:1;
    
left46px;
    
top50px;
}
.
Estilo1 {font-familyArialHelveticasans-serif}
-->
</
style>
<
script language="javascript">
<!--

//-->
function nuevoAjax()
{
    var 
xmlhttp=false;
     try 
    {
          
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     } 
    catch (
e
    {
          try 
        {
               
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
        catch (
E
    {
   
xmlhttp false;
  }
 }
if (!
xmlhttp && typeof XMLHttpRequest!='undefined'
{
  
xmlhttp = new XMLHttpRequest();
}
return 
xmlhttp;
}
function 
cargarContenido()
{
    var 
tipocontenedor;
    
    
contenedor document.getElementById('contenido');
    
tipo=document.getElementById('opc').value;
    
document.write(tipo);
    
ajax=nuevoAjax();
    
ajax.open("GET""tipo_pago.php?tipo="+tipo,true);
    
ajax.onreadystatechange=function(){
        if (
ajax.readyState==4)
        {
            
contenedor.innerHTML ajax.responseText
        
}
        if(
ajax.readyState!=4)
        {
            
contenedor.innerHTML='<img src="../images/loading.gif" alt="Cargando..." width="50" height="50" />';
        }
    }
    
ajax.send(null)
}
</script>
</head>

<body>
<div id="Layer1">
  <table width="457" border="1">
    <tr>
      <td colspan="2"><span class="Estilo1">Forma de Pago </span></td>
      <td width="241" colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td width="95"><label>
        <input name="opc" id="opc" type="radio" value="contado" onchange="cargarContenido();"/>
      </label></td>
      <td colspan="3">Contado
      <label></label></td>
    </tr>
    <tr>
      <td><input name="opc" id="opc" type="radio" value="cuota" checked="checked" onchange="cargarContenido();"/>
     </td>
      <td colspan="3">Cuota</td>
    </tr>
    <tr>
      <td><label>
        <input name="opc" id="opc" type="radio" value="cheque" onchange="cargarContenido();"/>
      </label></td>
      <td colspan="3">Cheque</td>
    </tr>
    <tr>
      <td colspan="4"><div id="contenido"></div></td>
    </tr>
    <tr>
      <td colspan="4">&nbsp;</td>
    </tr>
  </table>
</div>
</body>
</html> 
y este es tipo pago

Código PHP:
<?php
if($_GET)
{
    
$tipoX=$_GET["tipo"];
    echo
"*$tipoX*";
    switch (
$tipoX)
    {
        case 
"contado":
            echo
"contado";
            break;
        case 
"cheque":
            echo
"cheque";
            break;
        case 
"cuota":
            echo
"cuotas<br>";
            break;    
    }        
}
?>
alguna sugerencia

gracias--->
__________________
Me junto con los que Saben, Queriendo Saber.