Ver Mensaje Individual
  #2 (permalink)  
Antiguo 31/07/2009, 15:03
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: Dos valores a una lista/menu

Primero no uses <SELECT name="y"/> sino <SELECT name="y"> el simbolo /> se usa cuando la etiqueta no tiene cierre como <input />.

Segundo para poder lograr lo que quieres tienes que usar javascript. Esta es una posibilidad

Código html:
Ver original
  1. <script language="javascript">
  2. function verificarSiSonIguales(){
  3.     if(document.form1.x.options[document.form1.x.selectedIndex].value != document.form1.y.options[document.form1.y.selectedIndex].value){
  4.         alert("No son iguales");
  5.         return false;
  6.     }
  7. }
  8.  
  9. <form name="form1">
  10.     <SELECT name="x">
  11.         <OPTION value="opcion1">1</OPTION>
  12.         <OPTION value="opcion2">2</OPTION>
  13.     </SELECT>
  14.  
  15.     <SELECT name="y">
  16.         <OPTION value="opcion1">1</OPTION>
  17.         <OPTION value="opcion2">2</OPTION>
  18.     </SELECT>
  19.     <input type="submit" onclick="return verificarSiSonIguales();" />
  20. </form>