Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/05/2003, 12:18
White_Devi
 
Fecha de Ingreso: noviembre-2002
Ubicación: http://localhost/
Mensajes: 195
Antigüedad: 22 años, 2 meses
Puntos: 1
ayuda con este codigo de buscador plz

hola, tengo un form y quiero que cuando alguien seleccione uno de 2 radios, vaya a 2 acciones diferentes dependiendo del radio que seleccionaron entonces, tengo una funcion en JS y en el boton submit, tengo esto:

Código PHP:
<form name="searchForm">
<
input type="text" name="searchword2">
<
input type="radio" name="radio" value="1">
<
input type="radio" name="radio" value="2">
<
input type="submit" value="buscar" onclick="buscar()" 
y tengo esta funcion buscar()
Código PHP:
<script language="JavaScript">
<!--

function 
buscar(){
searchString document.searchForm.searchword2.value

if(
document.searchForm.radio[0].checked){
location.href "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q=" searchString;
}
if(
document.searchForm.radio[1].checked){
location.href "http://av.yahoo.com/bin/query?p=" searchString "&hc=0&hs=0";
}

}

// --> 
pero no me quiere funcionar, no se va a ninguna de las 2 paginas..


alguna ayuda??