Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Open.Window, Wysyłanie danych spowrotem
-Wieviór-
post
Post #1





Goście







Chcę zrobić coś takiego:

Mam na stroniem formularz i na tej stronie(macierzysta) klikam na link(bądź button), otwiera mi się nowe okno(Open.Window, dziecko) w którym mam powiedzmy Radio buttony, i wybieram jeden i wtedy on zaznacza się do formularza na stronie macierzystej, bądź też wpisuje się do jakiegoś labela na stronie macierzystej.

Ktoś ma pomysł jak to zrobić? (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 7)
kicaj
post
Post #2





Grupa: Zarejestrowani
Postów: 1 640
Pomógł: 28
Dołączył: 13.02.2003
Skąd: Międzyrzecz/Poznań

Ostrzeżenie: (0%)
-----


Tez to potrzebuje...
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #3





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


child.html
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <script type="text/javascript">
  5. function sendBack()
  6. {
  7. input_field = document.getElementById( 'pole' );
  8. x = input_field.value;
  9. //alert( x );
  10. parents_form = opener.document.getElementById( 'pole' );
  11. parents_form.value = x;
  12. }
  13. </script>
  14. <style type="text/css">
  15. </style>
  16. </head>
  17. <body>
  18. <form >
  19. <input type="text" id="pole" />
  20. <input type="button" value="Send this value to parent" onclick="sendBack()" />
  21. </form>
  22. </body>
  23. </html>

parent.html
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <title>Parent Window</title>
  5. <script type="text/javascript">
  6.  
  7. function wOpen()
  8. {
  9. okno = window.open( 'child.html' );
  10. }
  11. </script>
  12. <style type="text/css">
  13. </style>
  14. </head>
  15. <body>
  16. <form >
  17. <input type="text" id="pole" />
  18. <input type="button" value="open window" onclick="wOpen()" />
  19. </form>
  20. </body>
  21. </html>
Go to the top of the page
+Quote Post
-Wieviór-
post
Post #4





Goście







A jakbym chciał np. żeby zamiast wybierać Radio buttonem albo wpisywać wartość klikać na link, bo tu chodzi o system newsów i obrazki, czyli tak jakbym kliknął na obrazek i nazwa tego obrazka(np. obrazek.jpg) dodaje się do pola tego na stronie macierzystej (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)

Ten post edytował Wieviór 26.02.2005, 16:42:05
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <script type="text/javascript">
  4. function sendBack()
  5. {
  6. input_field = document.getElementById( 'pole' );
  7. x = input_field.value;
  8. parents_form = opener.document.getElementById( 'pole' );
  9. parents_form.value = x;
  10. }
  11.  
  12. function sendImageSrc( image )
  13. {
  14. parents_form = opener.document.getElementById( 'pole' );
  15. parents_form.value = image.src;
  16. }
  17.  
  18. <style type="text/css">
  19. </head>
  20. <img src="images/test.jpg" width="100" height="100" id="obrazek" onclick="sendImageSrc(this)" />
  21. <form >
  22. <input type="text" id="pole" />
  23. <input type="button" value="Send this value to parent" onclick="sendBack()" />
  24. </form>
  25. </body>
  26. </html>
Go to the top of the page
+Quote Post
-Wieviór-
post
Post #6





Goście







No niestety to mi nie działa (IMG:http://forum.php.pl/style_emoticons/default/rolleyes.gif)

W ogóle to ja chciałem zrobić tak, żeby się klikało na obrazek i już samo się dodawało na stronie macierzystej, a nie żeby jeszcze klikać wybierz... (IMG:http://forum.php.pl/style_emoticons/default/rolleyes.gif)
Go to the top of the page
+Quote Post
dr_bonzo
post
Post #7





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

Ostrzeżenie: (0%)
-----


1. Trzeba kliknac na obrazek -- nie widac go pewnie:) ale on tam jest, ew. wstaw prawidlowa sciezke do obrazka to go zobaczyzs.
2. Na buttona nie trzeba klikac -- po prostu go zostawilem z poprzedniego sktyptu -- dzieki niemu widac/nie widac gdzie jest obrazek.
Go to the top of the page
+Quote Post
-Wieviór-
post
Post #8





Goście







Lol działa!!! Jesteś wielki!!! Pijesz mleko?? (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
LOL!!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 04:30