"-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title>corrige exo1</title> </head> <body> <p><form name=monformulaire> <table BORDER WIDTH="300" HEIGHT="125" > <tr> <td><input type=button value= Nom ></td> <td><input type=text name=nom size=20></td> </tr> <tr> <td><input type=button value= Telephone ></td> <td><input type=text name=tel size=20></td> </tr> <tr> <td><input type=button value= Adresse ></td> <td><input type=text name=adresse size=20></td> </tr> </table> </form> </BODY> </HTML>
—
2)
Il vous faut trois fichiers :
1- Le fichier comportant la description des frames (frameset)
frames.html
"-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>corrige exo 1 - 2°</title>
</head>
<FRAMESET cols="40%,*">
<frame name=questionnaire src=quest.html>
<frame name=reponse src=rep.html>
</FRAMESET>
</HTML>
le fichier questionnaire (quest.html) qui comporte les boutons et qui a le fonctionnement indiqué :
quest.html
"-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>corrige exo2 questionnaire</title>
</head>
<body>
<p><form name=monformulaire>
<table BORDER WIDTH="300" HEIGHT="125" >
<tr>
<td><input type=button value= Nom onclick="alert(document.monformulaire.nom.value);"></td>
<td><input type=text name=nom size=20 value=''></td>
</tr>
<tr>
<td><input type=button value=Telephone onclick="alert(document.monformulaire.tel.value);"></td>
<td><input type=text name=tel value='' ” size=20></td>
</tr>
<tr>
<td><input type=button value= Adresse onclick="alert(document.monformulaire.adresse.value);"></td>
<td><input type=text name=adresse value='' size=20></td>
</tr>
</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('</P><P>telephone=',document.monformulaire.tel.value); window.parent.reponse.document.write('</P>');"> </form> </BODY> </HTML>
Pages: 1 2