PDA

View Full Version : reseting form action


ellcon
07-16-2002, 06:36 PM
I need to know how to reset the form action after a popup window has been opened. The popup window comes up after the form action has been changed through javascript. But then I need the form action to change back to it's original. Any ideas?
Thanks,
Ian

ShriekForth
07-16-2002, 10:50 PM
You could have the pop-up window call a function on the parent window to reset the action

<body onUnload="opener.resetAction()">

<body onUnload="opener.document.formName.action = 'newaction.html'">

Better yet if the child window has a form or a button on it you can use that to call the function on the opener reset, or have the child do it. But you can't always assume the user will use your method for closing the window, they could simply use the X in the corner. So the onUnload might work in that case.

ShriekForth