ginerjm Posted September 12, 2012 Share Posted September 12, 2012 Very simple subject but not the way I want to do it perhaps. Basically, I have a php-generated full-screen menu on screen. One link on it calls a js func to open up a small window on top and call a php script to handle the login process inside this popup. Once the user is validated (by the php script in that popup), I want to continue on to a full-size window, closing the login window behind me. I'd really like to re-use the original php menu's window, but if I have to open up a new window on top of it, so be it. Of course, if the logon fails, I'd like to return an error message to the popup window and let the user try again. So - how does one do this? Right now, my menu opens the popup just fine and the called url functions perfectly - I just can't get the next script top run in the appropriate window. Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted September 12, 2012 Share Posted September 12, 2012 you could remove the window from the DOM (js) or you could redirect to a new page (php or js). Quote Link to comment Share on other sites More sharing options...
lemmin Posted September 12, 2012 Share Posted September 12, 2012 If I understand you correctly, you want to go direct the user to the popup for input, then close the popup and continue navigation. The popup window's DOM object should contain a parent attribute that references the original window that opened it. You could use that object to refresh the original page, navigate elsewhere, or whatever you want to do. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted September 12, 2012 Author Share Posted September 12, 2012 Lemmin, I think you have the idea. Yes - the login/popup window does the verification/authentication and then decides if the user should continue on or re-try his login. My trouble is getting the "continue on" to appear in the right window. That's my dilemma. With IE I've not had good success addressing the parent window/script. From some things I've researched, I should be able to pass something back from my window.open (js) but that never works for me in IE. Do you have some code I could see that works? Or did you have something else in mind for this process? Quote Link to comment Share on other sites More sharing options...
lemmin Posted September 13, 2012 Share Posted September 13, 2012 Did you try window.opener? I would recommend just created an overlay for the login instead of a new window. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted September 13, 2012 Author Share Posted September 13, 2012 I'm starting to think along those lines now. But - I don't have a handle on how to interact with the user using js. I can write an httprequest to validate the input, but how does one get that input without having a new sript? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted September 14, 2012 Author Share Posted September 14, 2012 For anyone following my dilemma - here's my solution (still in the works, but designed) My main menu link has an onclick event on it that gets a boolean answer from the js code - this will then either call my appl's script, or stay right there on the menu (false = no submit). The onclick js function will open a dialog box (a hidden div actually) containing my login form fields. The form will receive the info from the user and on the 'log in' button another onclick will call a js function that grabs the input, makes an httprequest call to a php script that validates the user's entries and returns true or false (with a message). This is the result that is passed all the way back to the original menu onclick. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.