-1

I want users to input some url in a text field from a popup, and then, when submit the popup the parent page auto refresh and shows the url they have insert, with hyperlink to the site.

I have now set a scrypt to store the form in a cookie, that computer can read everytime users come back to the site.

You can see my work in: http://www.resmasecamadas.com/test

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Please have a look at this question: http://stackoverflow.com/questions/2797560/set-a-callback-function-to-a-new-window-in-javascript – Max Jul 22 '14 at 12:01

1 Answers1

0

You can achieve it using JS. you dont need to use cookies at all!
Observe this sample code.

    //On click of this button new Popup will be opened!
    <button onclick="myFunction();">Open popup</button>

    <script>
    function myFunction() {
    var popup = window.open("", "popup", "width=200, height=100");
    popup.document.write("<input type='text' name='text' id='text'><button onclick='window.opener.passFunction(text.value);'>click</button>");
    }

    function passFunction(x){
    document.write(x);
    }
    </script>

You can send data from pop up window using window.opener.someFunction(parameters)
here "someFunction" is a function in parent window!

bharat
  • 330
  • 1
  • 3
  • 13
  • It works, but the result page link is not clickable. I`am using cookies so that the computer saves users urls. I do not need the popup, i just need insert field for website urls, and href targer _blank results depending on insertions – user3864464 Jul 22 '14 at 16:58