Set different parent window
I am trying to update a parent window with data from a child window.
Now when my page gets refreshed I loose the reference of the parent page.
Is it possible to retain this value somehow or te set is again somehow with data I have posted?
I am assuming that some form information from the child window is being sent to a server side script, some number crunching then happens and you then want to display the results back in the parent window.
Originally Posted by funzoh
If that is so, another and imo easier approach would be to display the child window in the parent window (I'm not sure why you need 2 windows in the first place) and when the server side script has completed its number crunching it can then redirect back to the url of whatever was in the parent window originally and the latest information from the database should then be displayed.
Thanks for your reply.
I am creating a lookup button on which my visitors need to click to lookup some value from a database. The visitor needs to make a category selection which narrows down the list to a subselection from which they can choose. E.g. If you make a database with postal codes. They first need to select the state. The child window sends the data to the server and receives all zip codes in that state from which the visitor can select (also within the child window). When the visitor selects a zip-code, it returns its value to the parent window.
To be able to do so, I need to post the selected (first) in the child window, which refreshes the child window and which causes the parent setting to be reset.
I would like to accomplish this because else I would be forced to refill a lot of form data in the parent window which the user has entered earlier (like eg name, street, phone, and lots more). It also gets more complicated because I would have to lookup data from 2 different databases which require seperate database connections at one time. By splitting this functionality to a parent-child setup, it eases up the work a lot and it would make my site much easier to maintain.
Ok I think what you want is becoming clearer but if I understand you correctly in your example you would have a select list of states with a select list of zip codes with initially no options for zip codes until the user selects a state in the first select list.
If that is so, you can have both select lists on the one page with the states select list populated with the states and the zip codes select list initially empty.
When the user selects a state, the select lists onChange event handler can send an ajax request to the server to get the zip codes for that state and send them back to the client browser to populate the zip codes select list.
Then the selected state, zip code and other form data can be sent to a server side script for processing when submit is clicked.
This way you only need one window.
Am I still misunderstanding what you want?
Whow, that even sounds better than what I was hoping to do with that second window!
I think you have just helped me on the right tracks again. I will try this out today.
Many thanks Tirna!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)