Window.open avec target="_self&am

Résolu
marmotte08 Messages postés 43 Date d'inscription   Statut Membre Dernière intervention   -  
marmotte08 Messages postés 43 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

je suis actuellement en train de faire un site internet et je souhaitai integrer un moteur de recherche interne apres avoir cherche durant 2 jours toutes les solutions que j'ai pu trouver ne fonctionnai pas alors j'ai opté pour une methode a ma facon avec "case". Cela marche tres bien avec ce systeme et mon moteur de recherche interne marche a merveille MAIS je souhaite que les pages s ouvrent das le meme onglet mais comme je l'ai ecri ci dessou ca ne marche pas

function rechercher() {
var recherche= document.formulaire.recherche.value;
switch(recherche)
{
case'social':window.open('social.html',target="_self");break;
case'travail':window.open('social.html',target="_self");break;
case'administration':window.open('social.html',target="_self");break;
case'famille':window.open('social.html',target="_self");break;
case'logement':window.open('social.html',target="_self");break;
case'budget':window.open('social.html',target="_self");break;
case'endettement':window.open('social.html',target="_self");break;
case'santé':window.open('social.html',target="_self");break;
case'maladie':window.open('social.html',target="_self");break;
case'handicap':window.open('social.html',target="_self");break;

default:window.alert('d\èsol\é aucun mot ne correspond a votre recherche');
}
}

SAUF quand j'ecris le mots social ca s'ouvre bien dans le meme onglet alors que els autre mot sont ecri pareil ca devrai faire pareil . allé comprendre pk??
savez vous ou je me suis trompé et ce que je peux faire?


j'aurai aussi une deuxieme question:
j'aimerai que quand j'appuis sur enter ca valide ma recherche cad que ca fasse comme si les gens appuyai sur le bouton rechercher j'ai essayé ca

<form name="formulaire">
Saisir <span class="Copyright">UN</span> mot clé
<input type="text" name="recherche" size="15">    
<input type="button" value="Recherche" keydown="rechercher()" OnClick="rechercher()";>
</form>

mais ca marche pas

merci d'avance j'espere ne pas en demandé trop ^^
A voir également:

1 réponse

marmotte08 Messages postés 43 Date d'inscription   Statut Membre Dernière intervention   23
 
toujours personne pour m'aider?
j'espere que quelqu'un aura une idée
1