Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

back not showing form...

Status
Not open for further replies.

bartee

MIS
Mar 20, 2005
147
US
I have a form page.

For my form page, I just had to add a pop-up message before submitting.

It's not an alert, but a javascript call for window.open.

When the user clicks a button on the pop-up window -- it closes the window and continues to process using the parent window.

Problem is that once I added the pop-up, now if the user clicks back button -- it goes correctly to the form but does NOT display any of the info that was filled out.

How can I work around this and still use this pop-up window in betweeen?

thanks in advance.
 
Probably a good idea to post the code you're using so we can see where you're going wrong.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Enable Apps
 
Sorry.

I have a form with 5 text boxes. Those boxes are filled out completely by the user and the user submits.

On submit, I have the following javascript to open a pop-up window:

window.open ("","mywindow","menubar=no,resizable=no,location=no,titlebar=no,toolbar=no,status=no,resizable=1,width=725,height=485");formname.target="mywindow"

This seems to work fine.

The pop-up window has some text and it holds the form variables passed as hidden variables. There is a button on this pop-up window for the user to "continue". When the user clicks this button, the pop-up window should close and the hidden form and fields should submit back to the "opener" window.

Here is the code, it also seems to work correctly. It executes on click of the button (submit):

window.opener.name="original";
formname.target="original";
window.close();

Everthing works as intended except...

ever since I put the logic in for this pop-up window, when the user clicks the "back" button after the pop-up window, it goes back to the original form (which it should) BUT all of the form field values are blank. They must re-enter.

Any ideas?

thanks.

 
OK, that seems to be the browser's default way of handling things... If you press 'back' to the original form page, you most likely wish to fill the form out again. I'm thinking that what you're doing is slightly outside of the traditional way that browsers expect humans to treat forms, and thus getting some frustration from that.

The solution would be to store the values as a cookie on the user's machine, and then interrogate that cookie when the form loads to see if there are data values that need to be reloaded. There are hundreds of ready-made cookie set/get scripts floating about if you don't already have one in your bag of tricks.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Enable Apps
 
Yeah, I really don't like the idea of having to use this pop-up screen and then submit back to the original.

Unfortunately, I haven't been given much choice.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top