Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/05/2011, 21:38
Avatar de Etherman
Etherman
 
Fecha de Ingreso: abril-2011
Mensajes: 93
Antigüedad: 13 años, 1 mes
Puntos: 2
Respuesta: Mandar no sólo el Value sino también, el Text de un Option

Don php, dice que no lee nada, y lo puse así:

Código HTML:
Ver original
  1. <form action="PHPyAJAX.php"  id="opciones" >
  2.     <select id='opciones'>
  3.     <option value='1'>Opcion 1</option>
  4.     <option value='2'>Opcion 2</option>
  5.     <option value='3'>Opcion 3</option>
  6.     </select>
  7. <input type="submit" value="Mandarselo a Php" />
  8.  
  9. <script language="Javascript">
  10.     .
  11.     .
  12.     .
  13.      
  14.     var campo_select = document.getElementById('opciones');
  15.     var indice = campo_select.selectedIndex;
  16.      
  17.     var texto = campo_select.options[indice].text;
  18.     var valor = campo_select.value;
  19.      
  20.         ajax.open("POST", "PHPyAJAX.php",true);
  21.         ajax.onreadystatechange=function() {
  22.             if (ajax.readyState==4) {
  23.                 respuesta = ajax.responseText;
  24.             }
  25.         }
  26.         ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  27.         ajax.send("valor="+valor+"&texto="+texto);
  28. </form>

¿¿Hay algo mal??
muchisimas gracias por el apoyo, y buen karma!