Javascript refresh parrent window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Javascript refresh parrent window

Post by php_wiz_kid »

Hey everybody,
I have a question. Ok, when a user logs into my web site for the first time they have to activate their account before they can navigate through the site. Now to activate the account they have to click on a link that opens up a new window. Here they enter the activation code and press submit to send the MySQL query to delete their number out of the "need to activate account" table. Then they close the window and have to log out and log back in before they can navigate. What I want to do is when they press submit the parent web page will refresh so they don't have to manually refresh, or log and log back in. Thanks.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

put this in the child window

you will need to put this AFTER the user has removed him self from the table.

Code: Select all

<body onload="window.opener.location.href='page.php')">
page.php = page where the parent window should go.
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

This should work, I was thinking something in onSubmit, could it work either way. Sorry, I don't program JS.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

you could put it onclick but what if there was a error? 8O.

you can put this after making sure everything is ok. :)
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

If there was an error it's not like it matters. That's a good thought though.
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

That didn't work at all. Nothing even refreshes. Any other ideas?
McCain83
Forum Newbie
Posts: 1
Joined: Tue Jul 08, 2003 8:12 pm

Post by McCain83 »

Well, if you're just refershing, maybe

Code: Select all

<body onLoad="window.opener.location.reload()">
I think that's it, at least.
Post Reply