Exercice HTML: Simple Formulaire
Rédigé par BENKIRANE Fatima Ezzahra, Publié le 08 Janvier 2012, Mise à jour le Dimanche, 30 Août 2020 16:34Participez au vote ☆☆☆☆☆★★★★★
Rappel : alert(chaine) ouvre une fenêtre pop-up contenant la chaîne et un bouton OK.Donnez le code source des divers fichiers nécessaires.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
"-//w3c//dtd html 4.0 transitional//en" html head titlecorrige exo1span style="color: #66cc66;">/title span style="color: #66cc66;">/head body pform> name=monformulaire> table> BORDER WIDTH="300" HEIGHT="125" > tr tdinput> type=button value= Nom >span style="color: #66cc66;">/td tdinput> type=text name=nom size=20/td span style="color: #66cc66;">/tr tr tdinput> type=button value= Telephone >span style="color: #66cc66;">/td tdinput> type=text name=tel size=20/td span style="color: #66cc66;">/tr tr tdinput> type=button value= Adresse >span style="color: #66cc66;">/td tdinput> type=text name=adresse size=20/td span style="color: #66cc66;">/tr span style="color: #66cc66;">/table span style="color: #66cc66;">/form span style="color: #66cc66;">/BODY span style="color: #66cc66;">/HTML |
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 45 46 47 48 49 50 51 |
2) Il vous faut trois fichiers : 1- Le fichier comportant la description des frames (frameset) frames.html <!doctype html public "-//w3c//dtd html 4.0 transitional//en" html head titlecorrige exo 1 - 2°span style="color: #66cc66;">/title span style="color: #66cc66;">/head FRAMESET> cols="40%,*" <frame> name=questionnaire src=quest.html> <frame> name=reponse src=rep.html> span style="color: #66cc66;">/FRAMESET span style="color: #66cc66;">/HTML le fichier questionnaire (quest.html) qui comporte les boutons et qui a le fonctionnement indiqué : quest.html <!doctype html public "-//w3c//dtd html 4.0 transitional//en" html head titlecorrige exo2 questionnairespan style="color: #66cc66;">/title span style="color: #66cc66;">/head body pform> name=monformulaire> table> BORDER WIDTH="300" HEIGHT="125" > tr tdinput> type=button value= Nom onclick="alert(document.monformulaire.nom.value);"/td tdinput> type=text name=nom size=20 value=''/td span style="color: #66cc66;">/tr tr tdinput> type=button value=Telephone onclick="alert(document.monformulaire.tel.value);"/td tdinput> type=text name=tel value='' ” size=20/td span style="color: #66cc66;">/tr tr tdinput> type=button value= Adresse onclick="alert(document.monformulaire.adresse.value);"/td tdinput> type=text name=adresse value='' size=20/td span style="color: #66cc66;">/tr span style="color: #66cc66;">/table center <input> type=button value=valider onClick="window.parent.reponse.document.write('nom =', document.monformulaire.nom.value); window.parent.reponse.document.write(' adresse=', document.monformulaire.adresse.value); window.parent.reponse.document.write('span style="color: #66cc66;">/PPtelephone=',document.monformulaire.tel.value); window.parent.reponse.document.write('span style="color: #66cc66;">/P');"> span style="color: #66cc66;">/form span style="color: #66cc66;">/BODY span style="color: #66cc66;">/HTML |