j' ai modifie ma page mere coe suit:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <head>
<script>
var mywindow = null;
function ohh(){
if(mywindow != null && mywindow.closed == false) {
alert("The window is already open");
}
else {
mywindow = window.open("page.php","PopUp", "width=500,height=500,left=" + ((screen.width - 1000)/2) + ",top=" + ((screen.height - 1000)/2) + "location=yes,status=yes,toolbar=yes,scrollbars=yes resizable=yes");
}
}
</script>
</head>
<form name="test" method="post">
Your choice is: <input type="text" id="answer" size="20">
<input type="button" name="lancer" value="Ouvre" onclick="ohh()">
</form>
</body> |
et ma page Pop Up:
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
| <head>
<script type="text/javascript">
function check(choix)
{
self.opener.document.test.getElementById("answer").value=choix;
}
</script>
</head>
<?php
echo '<form method="POST" name= "pp" action="">';
echo '<fieldset>';
require_once ('../mysqli_connect.php');
$q = "SELECT Biz_rule_ID, Biz_rule_code FROM business_rules ORDER BY Biz_rule_ID ASC";
$r = mysqli_query($dbc, $q);
if (mysqli_num_rows($r) > 0) {
while ($list_row = mysqli_fetch_array($r, MYSQLI_NUM)) {
echo '<p><input type="radio" name="choix" onclick="check(this.value)" value=" ' . $list_row[0] . '" > ' . $list_row[1] . '</p><br />';
}
mysqli_free_result($r);
}
else {
echo 'There is no business rules registered in the database';
}
unset($list_row);
echo '</form>';
?> |
mais j' obtiens l' erreur:
La ligne 5 de la page page.php est:
self.opener.document.test.getElementById("answer").value=choix;
cette fois je veux juste que en cliquant sur un bouton radio dans la fenetre Pop Up sa valeur s'affiche dans la zone de texte de ma page mere
Merci
Partager