Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/07/2011, 12:06
Avatar de perryjr
perryjr
 
Fecha de Ingreso: julio-2010
Ubicación: Granada, Spain, Spain
Mensajes: 190
Antigüedad: 13 años, 9 meses
Puntos: 27
Respuesta: Redireccionar según variable (contenido de caja de texto).

Código HTML:
Ver original
  1. <input type="text" id="field" />
  2. <button onClick="go();">Ir</button>
  3.  
  4.  
  5. function go() {
  6.   var loc = document.getElementById('field').value;
  7.   location.href = '/' + loc + '.php';
  8. }
  9.  

Así si el usuario escribe "283", pues le llevará a "/283.php". ¿Suficientemente rápido la respuesta? ;P
__________________
I (L) Google