I'm trying a three page system to check if a username has been registered already. I'm having trouble on the second page, which is what I need help with. The code I have so far is: Page one (registration page): <head><script type="text/javascript"> function myPopup() { window.open("checkusername.php", "popUp", "status = 1, height = 300, width = 300, resizable = 0" )} </script></head> <body> <p onClick="myPopup()">CLICK ME!</p> <form name=myform> <input name=username type=text value='hi!'> </form></body> Code (markup): Page 2 (checkusername.php) takes whatever is in the "username" input on the original page and puts it in the input on it's own page (also named "username"). <head> <script> document.myform.username.value = opener.myform.username.value; </script> </head> <form name='myform' action='checkusername2.php' method='post'> <input type='text' name='username' value=''> </form> Code (markup): So far, the popup opens just fine and displays the username input, but the value doesn't transfer. Javascript is not my strong point, so any help would be awesome here -Submerged PS. Someone might notice I posted this in the HTML section as well, I didn't see a Javascript in that area and didn't think about it being in the same area as PHP
That code must be generating an error, because it runs before the form has been rendered. window.onload=function(){document.myform.username.value = opener.myform.username.value;} Code (markup):