I require to appear the Name which i click on the "new.php" page in the "Window_open.php" page..I use some Java Script also to accomplish this but I couldn't..

how to pass textbox value in popup....

Could you pleas Help ...!!!

Expand|Select|Wrap|Line Numbers

1. ----------The Code in "Window_open.php" -------------------
2.
3. <html>
4.
5. <head>
6. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7. <title>New Page 1</title>
8. </head>
9.
10. <body>
11.
12.
13. <FORM>
14. <INPUT type="button" value="New Window!" onClick="window.open('new.htm','mywindow','width=400,height=200')">
15. <br>
16. </FORM>
17.
18. <table width="533" height="242" border="1">
19. <tr>
20. <td align="center" valign="middle">Name<br><?php echo $post["txt"]?></td>
21. </tr>
22. </table>
23. </body>
24.
25. </html>
26.
27.
28. ------------------code in "new.php"---------------------------------

Expand|Select|Wrap|Line Numbers

1. <html>
2. <body>
3.
4. <p><font size="5">This is the result of&nbsp; on click Opening
5. Window..............</font><br>
6. <br>
7. <br>
8. <a id="100" onClick="window.close(),pass(100)">Taniya Moses<br></a>
9. <a id="101" onClick="window.close(),pass(101)">Ranjan Ramanayaka<br></a>
10. <a id="102" onClick="window.close(),pass(102)">Wikram Silva<br></a>
11. <a id="103" onClick="window.close(),pass(103)">Wikram Silva<br></a>
12. <a id="104" onClick="window.close(),pass(104)">Janaka Wujerathna<br></a>
13. <br>
14.
15.
16. <Script type="text/javascript">
17. function pass(I)
18. {
19. var C = document.getElementById("I").value;
20. document.getElementById("txt").value = C;
21. window.location.href="new.html";
22. //window.close();
23. }
24. </Script>
25. </p>
26. <form action="window_open.html", method="post">
27. <input type="hidden" id="txt" name="txt" />
28. </form>
29.
30. </body>
31.
32. </html>

Recommended Answers

All 2 Replies

The text box is not in the form, If the text box is in the form, We can retrieve the textbox value in the new.php page using $_REQUEST variable.

If you need it in new.html page, we need to give an id to text box and we can display that value in the popup as

window.parent.getElementById('textboxid').value

saiprem says true. I don't see a textbox anywhere in your HTML...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.