Changer la cible d'un simple script recherche

Fermé
matiou34 Messages postés 198 Date d'inscription mardi 22 avril 2008 Statut Membre Dernière intervention 27 janvier 2015 - 25 nov. 2010 à 15:04
 more 2 rire ( ..dsl ! ) - 1 mars 2011 à 14:48
Bonjour,

j'ai le script ci-dessous, je souhaite que la recherche s'affiche dans une frame de ma page. Comment puis-je faire ?

Merci beaucoup !


Le script :

<script language="Javascript">
function callsearch(){
searchwords=document.searchform.searchwords.value.toLowerCase();
while (searchwords.indexOf(" ")>-1)
{
pos=searchwords.indexOf(" ");
searchwords=searchwords.substring(0,pos)+"+"+
searchwords.substring(pos+1);
}
location="world/index.php?pays="+searchwords;
}
target="informations" <--------------- comme cela ??
</script>

La recherche :

<form action="javascript:callsearch();" name="searchform" method="post">
<p><input type="text" name="searchwords" size="15"> <input TYPE="button"
onclick="javascript:callsearch()" VALUE="Search"> </p>
</form>


:)



A voir également:

1 réponse

Utilisateur anonyme
25 nov. 2010 à 22:31
Aie!! je te conseille d'utiliser ajax !! c'est plus propre !
1
more 2 rire ( ..dsl ! )
1 mars 2011 à 14:48
ajax avec java.........heuuuuu .........non ...avec javel j'croi .. ...pas sur klk 1 veu fair 1 post ..?
0