Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/08/2012, 13:57
sergiop21
 
Fecha de Ingreso: diciembre-2008
Mensajes: 805
Antigüedad: 15 años, 5 meses
Puntos: 20
variables js guardar en php

Buenas a todos!!! disculpe, las molestias, pero me parece que me estoy enredando en algo muy facil.
tengo dicho select
Código HTML:
<table width="40%">
<tr>
    <td><label><strong>VISA</strong></label></td>
   <td><input type="radio" name="psp_Product" value="14" tabindex="15" onkeypress="return handleEnter(this, event)" onClick="getChecked(this.value)"> </td>
</tr>
<tr>
    <td><label><strong>MASTERCARD</strong></label></td>
<td><input type="radio" name="psp_Product" value="5" tabindex="16" onkeypress="return handleEnter(this, event)" onClick="getChecked(this.value)" ></td>
            </tr>
<tr>
<td><label><strong>AMERICAN EXPRESS</strong></label></td>
<td><input type="radio" name="psp_Product" value="1" tabindex="17" onkeypress="return handleEnter(this, event)" onClick="getChecked(this.value)" > </td>

</tr>
</table>



Código:
function getChecked(element) {
    
    var element = document.forms[0].elements['psp_Product']
    
   
    len = element.length
    for (i = 0; i <len; i++) {
        if (element[i].checked) {
            //return element[i].value
            document.getElementById("val_prod").value = element[i].value;
             val_prod = element[i].value;
            switch (element[i].value)
            {
                case '5':
                          document.getElementById('formualrioPersonal3').style.display = 'block';
                          break;
                default:
                        document.getElementById('formualrioPersonal3').style.display = 'none';
                        break;

            }            
            
        }
    }
    return '';
}
hasta ahi todo bien, lo que hace es cuando yo selecciono una opcion del radio. con la funcion getChecked me dice cual es el valor seleccionado. bien ese valor yo lo quiere guardar en un variable de php, como puedo hacerlo??? desde ya muchas gracias!!!