Voici un exemple :
index.html
Code :
<html>
<head>
<title>DEMO</title>
</head>
<body>
<form name="formulaire">
Champ 1: <input type="text" name="champ1" size="20"><br>
Champ 2: <input type="text" name="champ2" size="20"><br>
Champ 3: <input type="text" name="champ3" size="20"><br><br>
<a href="#" onClick="window.open('page2.html'); return false;">Cliquez ICI</a> pour ouvrir la deuxième page.<br>
Champ 4(read-only): <input type="text" name="champ4" size="20" disabled><br>
Champ 5(read-only): <input type="text" name="champ5" size="20" disabled>
</form>
</body>
</html>
page2.html
Code :
<html>
<head>
<title>DEMO</title>
<script>
function sendInfo() {
window.opener.formulaire.champ4.value = document.formulaire.champ4.value;
window.opener.formulaire.champ5.value = document.formulaire.champ5.value;
window.close();
}
</script>
</head>
<body>
<form name="formulaire">
Champ 4<input type="text" name="champ4" size="20"><br>
Champ 5<input type="text" name="champ5" size="20"><br>
</form>
<a href="#" onClick="sendInfo();">SEND INFO</a>
</body>
</html>