Bonsoir � tous,
Depuis un moment je travail sur une application de base de donn�es qui dispose d'un module permettant un interfa�age web.
Cette interface Web est modifiable vie un fichier de style css ainsi que par l'interm�diaire d'un fichier javascript .js . Mon souci est que je ne ma�trise pas du tout le javascript.
Voici le probl�me :
Je dispose donc d'un fichier .js dans lequel son d�finit diff�rentes fonctions. Je voudrais modifier l'une d'elle � savoir :
pour ceux qui se demanderait ce qu'est la fonction Accent, voici :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 function Link(Zone,Terme,Champ,Base,Fenetre) { Terme = Accent(Terme); if ( Champ != "" ) Champ = "/(" + Champ + ")"; // Transfert des éléments dans le formulaire document.LIEN.t2005.value = document.forms[Base].t2005.value; document.LIEN.t2006.value = document.forms[Base].t2006.value; if ( Base == "LINK" ) { document.LIEN.t2018.value = ""; } else { document.LIEN.t2018.value = "1"; } if ( Fenetre == "" ) { document.LIEN.t2004.value = "1"; document.LIEN.t2000.value = "(\"" + Terme + "\"" + Champ + ")"; document.LIEN.t2001.value = "(#" + Terme + "#" + Champ + ")"; document.LIEN.t2002.value = Zone + "=" + Terme ; document.LIEN.action = document.LIEN.t2009.value + "/[in=genisis" +document.LIEN.t2013.value + "0.in]/"; document.LIEN.submit(); } else { var URL=document.LIEN.t2009.value + "/[in=genisis" +document.LIEN.t2013.value + "0.in]/"; URL=URL + "?t2000=" + escape("(\"" + Terme + "\"" + Champ + ")"); URL=URL + "&t2001=" + escape("(#" + Terme + "#" + Champ + ")"); URL=URL + "&t2002=" + escape(Zone + "=" + Terme); URL=URL + "&t2003=" + escape(document.LIEN.t2003.value); URL=URL + "&t2004=" + escape(document.LIEN.t2004.value); URL=URL + "&t2005=" + escape(document.LIEN.t2005.value); URL=URL + "&t2006=" + escape(document.LIEN.t2006.value); URL=URL + "&t2007=" + escape(document.LIEN.t2007.value); URL=URL + "&t2009=" + escape(document.LIEN.t2009.value); URL=URL + "&t2010=" + escape(document.LIEN.t2010.value); URL=URL + "&t2011=" + escape(document.LIEN.t2011.value); URL=URL + "&t2012=" + escape(document.LIEN.t2012.value); URL=URL + "&t2013=" + escape(document.LIEN.t2013.value); URL=URL + "&t2014=" + escape(document.LIEN.t2014.value); URL=URL + "&t2015=" + escape(document.LIEN.t2015.value); URL=URL + "&t2016=" + escape(document.LIEN.t2016.value); URL=URL + "&t2017=" + escape(document.LIEN.t2017.value); URL=URL + "&t2018=" + escape(document.LIEN.t2018.value); msg=window.open(URL,"Index","location=no,status=no,toolbar=no,directories=no,resizable=yes,menubar=no,scrollbars=yes,"+Fenetre); msg.focus(); } }
Pour plus de clart�, voici le code html qui est g�n�r� par l'application :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 function Accent(Terme) { var ACCAPP = "CueaaaaceeeiiiAAEooouuyOUaiounN"; var ACCWIN = "ÇüéâäàåçêëèïîìÄÅÉôöòûùÿÖÜáíóúñÑ"; var i,j; var CarAns,CarApp; for (i=0; i<31; i++) { CarAns = ACCWIN.charAt(i); CarApp = ACCAPP.charAt(i); j=Terme.indexOf(CarAns,0); while ( j != -1) { Terme = Terme.replace(CarAns,CarApp); j=Terme.indexOf(CarAns,0); } } return Terme; } // Retour au formulaire d'interrogation function NewQuestion() { location.href = document.ENVOI.t2007.value; }
(la ligne qui nous int�resse est "Liens")
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 '<tr><td>'/ '<table width=100% border=0 cellpadding=3 cellspacing=0 bgcolor=#FFFFFF>'/ if p(v1) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>nom</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' v1, '</font></td></tr>'/ fi,/ if p(v2) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Catégorie</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' v2, '</font></td></tr>'/ fi,/ if p(v4) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Fonction</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' v4, '</font></td></tr>'/ fi,/ if p(v5) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Résumé</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' v5, '</font></td></tr>'/ fi,/ if p(v6) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Liens</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' (|<a href='javascript:Link("Liens","|v6|","1","LINK","");'>|,v6+|</A>|),'</A>', '</font></td></tr>'/ fi,/ if p(v7) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Téléphone</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' v7, '</font></td></tr>'/ fi,/ if p(v8) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Email</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' (|<a href="mailto:|v8|">|,v8+|</A>|),'</A>', '</font></td></tr>'/ fi,/ if p(v9) then, '<tr><td valign=TOP WIDTH=29% bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>Site Web</font></td><td valign=top bgcolor=#FFFFFF><font color=#000000 SIZE=2 FACE=Verdana>' (|<a target="_blank" href="http://|v9|">|,v9+|</A>|),'</A>', '</font></td></tr>'/ fi,/ '</table>'/ '</td></tr>'/
Ne vous inqui�tez pas, je ne demande pas la modification de tout le code mais seulement de la partie suivante :
Je voudrais que le champ "Terme" qui est utilis� dans la fonction puisse contenir plus d'un �l�ment, �l�ments qui seraient s�par�s par une virgule.
Je m'explique :
J'ai une base de donn�es qui contient plusieurs noms de personnes avec leurs informations de contacts, fonctions etc... et j'ai aussi un champ qui s'appel liens, ce dernier permet de lister toutes les personnes en contact avec la personne consult�e.
exemple : Liens : jean-pierre dupont, st�phane dupr�, �lise lef�vre..
La fonction Link permet en cliquant par exemple sur "jean-pierre dupont" d'acc�der � sa fiche (en refaisant une requ�te dans la base). Pour le moment cette fonction ne me permet pas d'entrer plusieurs noms dans ce champ mais seulement un seul. Je voudrais pouvoir en entrer plusieurs en utilisant comme s�parateur une virgule.
s'il y avait quelqu'un d'ass�s sympa pour se pencher sur mon probl�me, cela fait un petit moment que je me triture les m�ninges...
Merci d'avance pour vos lumi�res
Yaz
Partager