Bonjour,
j'ai un problème très bizarre : je souhaite faire un code qui affiche au choix 2 photos, l'une d'elle étant choisie de préférence si l'utilisateur la rentre sinon l'autre. Et en fait, ça ne marche qu'avec 2 codes distincts : un si l'utilisateur rentre une photoet un si l'utilisateur ne rentre pas de photo
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 <script> var sesainfoauthor = new Array(3); sesainfoauthor[0] = new Object; sesainfoauthor[1] = new Object; sesainfoauthor[2] = new Object; if (h_CurrentSkinType=='h_Edit') { document.write("<td class='h-fieldHeaderEdit-bgtext'>"); document.write("Last Name<br><"+"input size='50' type='text' name='h_getName'><br>"); document.write("First Name<br><"+"input size='50' type='text' name='c_getFirstName'><br>"); document.write("Job Title<br><"+"input size='50' type='text' name='c_getJob'><br>"); document.write("Phone number<br><"+"input size='50' type='text' name='c_getPhone'><br>"); document.write("Mobile number<br><"+"input size='50' type='text' name='c_getMobile'><br>"); document.write("e-Mail address<br><"+"input size='50' type='text' name='c_getMail'><br>"); document.write("<br>You may provide your photo (jpg or gif format) in the attachment area at the bottom<br>"); } else { sesaArray=loadsesa(h_OriginatorDistinguishedName);// h_LastEditorDistinguishedName var idNotes=extract_NotesID(h_OriginatorDistinguishedName);//h_OriginatorDisplayName var ind=0; var comp=0; do { sesainfoauthor[ind]=load_personal_data(sesaArray,ind); comp=extract_idnotes_sansfin(sesainfoauthor[ind].idnotes); ind++; } while (comp!=idNotes); document.write("<td class='h-page-text' width='200'>"); var sFileName=showID(); document.write("</td><td class='h-page-text'>"); var titi=sesainfoauthor[ind-1].urlphoto; if ((sesainfoauthor[ind-1].urlphoto.length==0)&&(sFileName.length==0)) sesainfoauthor[ind-1].urlphoto="http:\/\/directory.schneider-electric.com\/Global\/Corp\/IntDirPhotos.nsf\/PhotosByGUID\/SESA0000\/$File\/sesa0000.jpg"; // ici, on sélectionne la photo entrée par l'utilisateur if ((sFileName.length>0)) titi=sFileName; document.write('<img src=\"'+titi+'\" height=\"100\"><br>'); document.write(c_Job+'<br><br>'); document.write("Phone :"+c_Phone+"<br>"); document.write("Mobile :"+c_Mobile+"<br>"); document.write("E-Mail :"+c_Mail+"<br>"); } </script>et si je fais un code unique, il ne marche plus si l'utilisateur ne rentre pas de photo : peut-on m'aider ?
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 <script> var sesainfoauthor = new Array(3); sesainfoauthor[0] = new Object; sesainfoauthor[1] = new Object; sesainfoauthor[2] = new Object; if (h_CurrentSkinType=='h_Edit') { document.write("<td class='h-fieldHeaderEdit-bgtext'>"); document.write("Last Name<br><"+"input size='50' type='text' name='h_getName'><br>"); document.write("First Name<br><"+"input size='50' type='text' name='c_getFirstName'><br>"); document.write("Job Title<br><"+"input size='50' type='text' name='c_getJob'><br>"); document.write("Phone number<br><"+"input size='50' type='text' name='c_getPhone'><br>"); document.write("Mobile number<br><"+"input size='50' type='text' name='c_getMobile'><br>"); document.write("e-Mail address<br><"+"input size='50' type='text' name='c_getMail'><br>"); document.write("<br>You may provide your photo (jpg or gif format) in the attachment area at the bottom<br>"); } else { sesaArray=loadsesa(h_OriginatorDistinguishedName);// h_LastEditorDistinguishedName var idNotes=extract_NotesID(h_OriginatorDistinguishedName);//h_OriginatorDisplayName var ind=0; var comp=0; do { sesainfoauthor[ind]=load_personal_data(sesaArray,ind); comp=extract_idnotes_sansfin(sesainfoauthor[ind].idnotes); ind++; } while (comp!=idNotes); document.write("<td class='h-page-text' width='200'>"); var sFileName=showID(); document.write("</td><td class='h-page-text'>"); /* je dois copier sesainfoauthor[ind-1].urlphoto dans titi, car sinon le code <img src=...> ci-dessous ne marchait pas */ var titi=sesainfoauthor[ind-1].urlphoto; if ((sesainfoauthor[ind-1].urlphoto.length==0)&&(sFileName.length==0)) sesainfoauthor[ind-1].urlphoto="http:\/\/directory.schneider-electric.com\/Global\/Corp\/IntDirPhotos.nsf\/PhotosByGUID\/SESA0000\/$File\/sesa0000.jpg"; // Si je remplace toto par titi, ça ne marche plus ! if (sFileName.length>0) toto=sFileName; else; document.write('<img src=\"'+titi+'\" height=\"100\"><br>'); document.write(c_Job+'<br><br>'); document.write("Phone :"+c_Phone+"<br>"); document.write("Mobile :"+c_Mobile+"<br>"); document.write("E-Mail :"+c_Mail+"<br>"); } </script>
Partager