salut tout le monde,
j'ai besoin d'un script ajax qui permet d'actualiser des champs dans mon formulaire depuis un popup qui est ouverte, j'ai trouvé un solution javascript :
page principal :
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <!--compatibility mode--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <body> <form> <input id="details" name="details"> <input type="button" name="choice" onClick="window.open('t2.html','popuppage','width=850,toolbar=1,resizable=1,scrollbars=yes,height=700,top=100,left=100');" value="Open popup"> </form> </body> </html>
page popup :
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> </head> <body> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function sendValue (s){ var selvalue = s.value; window.opener.document.getElementById('details').value = selvalue; window.close(); } // End --> </script> <form name="selectform"> <input name="details" value=""> <input type=button value="Copy input to parent opener" onClick="sendValue(this.form.details);"> </form> </body> </html>
Mais je veux utiliser ajax pour ne pas être bloqué par les navigateurs.
Merci d'avance
Partager