[js] informatie vanuit een popup

Pagina: 1
Acties:

  • Alnitak
  • Registratie: September 2001
  • Laatst online: 20-12-2021
ik heb een input text veld met daar achter een knop die een popup opent met opties uit een database
nu wil ik graag dat ie dat invlut in het text veld.
ik heb al wat op google rond gekeken maar kan niet met de goede zoek termen op de knoppen komen.
dit is wat ik heb :

index.php
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<html>
    <head>
        <title>Test</title>
        <script type="text/javascript">
            function open_popup()
            {
                window.open("popup.php","_blank","toolbar=yes, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
            }
        </script>
    </head>
    <body>
        <form name="test">
            <input type=text name="field1">
            <a href=Javascript:open_popup()>X</a>
        </form>
    </body>
</html>


popup.php
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<html>
    <head>
        <title>PopUP</title>
        <script type="text/javascript">
            function close_window()
            {
                parent.document.test.field1.value = "test"; <-- dit klopt inderdaad niet :P
                
                window.close();
            }
        </script>
    </head>
    <body>
        <a href=Javascript:close_window()>X</a>
    </body>
</html>

Little known fact about Middle Earth: The Hobbits had a very sophisticated computer network! It was a Tolkien Ring...


  • djluc
  • Registratie: Oktober 2002
  • Laatst online: 13:54
opener.document.......

  • dominic
  • Registratie: Juli 2000
  • Laatst online: 08-02 14:55

dominic

will code for food

of window.opener.functie()

Download my music on SoundCloud


  • Alnitak
  • Registratie: September 2001
  • Laatst online: 20-12-2021
window.opener.document.test.field1.value = 'test';

werkt prima thnx

Little known fact about Middle Earth: The Hobbits had a very sophisticated computer network! It was a Tolkien Ring...