It is currently Fri Jul 25, 2014 12:38 pm Advanced search

On submit refresh parent page

Technical support, bug reports, feature requests and more.

On submit refresh parent page

Postby davidhharnett » Wed May 27, 2009 12:31 pm

Hi,
I know there is a hundred answers to refresh parent page on click with an Iframe but I cant seem to get this one to work
I am trying to get a login form in a highslide iframe that when you click submit it logs in and then refreshes the parent page
the link is here
http://www.jd-solutions.biz/te2/
I have just left it as a link next to the search box that says "content in Iframe"

The code for the form on the iframe is
Code: Select all
<form method='POST' action='index.php'>
    <input type='hidden' name='list' value='user'>
    <input type='hidden' name='method' value='login'>
   
    Name:     <input type='text' name='name' value="admin"><br>
    Password: <input type='password' name='password'><br>
   
    <input type='submit' value='Ok' name='gsubmit'  onsubmit="parent.location.refresh()">
</form>


Any help would be greatly appreciated
davidhharnett
 
Posts: 2
Joined: Wed May 27, 2009 12:26 pm

Re: On submit refresh parent page

Postby RoadRash » Wed May 27, 2009 1:05 pm

Will this work?
Code: Select all
<input type='submit' value='Ok' name='gsubmit'  onclick="parent.location.reload();">
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no
User avatar
RoadRash
 
Posts: 8207
Joined: Tue Jul 15, 2008 8:43 pm
Location: Fredrikstad, Norway

Re: On submit refresh parent page

Postby davidhharnett » Wed May 27, 2009 2:00 pm

RoadRash wrote:Will this work?
Code: Select all
<input type='submit' value='Ok' name='gsubmit'  onclick="parent.location.reload();">


No Unfortunately not, That way it refreshes before it logs you in where as the orignal way logs you in but refreshes the iframe and not the parent
davidhharnett
 
Posts: 2
Joined: Wed May 27, 2009 12:26 pm

Re: On submit refresh parent page

Postby torstein.honsi » Wed May 27, 2009 7:27 pm

The way you are currently doing it, the parent page is refreshed on (= before) submit, the iframe and everything is immediately lost and the login form never submits.

Instead, you need to use a second login handler page (index.php) within the iframe, which refreshes the parent page on load if the user is successfully logged in.
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9185
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: On submit refresh parent page

Postby igw » Thu Jun 25, 2009 2:23 pm

I think I am tying to do the same type of thing and while I doubt it is a highslide question I'd appreciate any help getting this to work. It might be pretty simple, but I usually just throw things together and try to make things work, even if I dont really understand what might be going on.

So here is what I am doing. The main page has a 'Login' link which will bring up an iframe like so:
Code: Select all
<a href="login1.php" onclick="return hs.htmlExpand(this, { objectType: 'iframe', wrapperClassName: 'draggable-header' } )">Login</a><div class="highslide-heading">Enter Login Info:</div>


Inside that window is a form for username/password. Obviously if the info is incorrect or not complete it will go to another page in the iframe that just says to go back and do it right. If the info is correct what I would like to do is say 'login sucessful CLICK HERE to close this page' which will close the iframe and refresh the main page at the same time. I can't really find what I am looking for though (that works anyway).

Website is http://www.ig-wilson.com if you want to take a look...login link is down at the bottom of the menu on the left. Be gentle, I'm not a serious programmer or anything :) Thanks in advance for any assistance
igw
 
Posts: 2
Joined: Thu Jun 25, 2009 2:06 pm

Re: On submit refresh parent page

Postby torstein.honsi » Fri Jun 26, 2009 9:03 am

All you have to do is to refresh the parent page - and the Highslide popup will disappear with the old page.

Code: Select all
Login successful.
<a href="javascript:parent.window.location.reload()">CLICK HERE</a>
to close this page
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9185
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: On submit refresh parent page

Postby igw » Sat Jun 27, 2009 3:22 am

Wow that was easy :) thank you very much!!

Highslide is awesome by the way and you sir are my new hero. Thanks for the amazing app and for the help you provide on the forums.
igw
 
Posts: 2
Joined: Thu Jun 25, 2009 2:06 pm

Re: On submit refresh parent page

Postby torstein.honsi » Mon Jun 29, 2009 1:26 pm

You're welcome!
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9185
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: On submit refresh parent page

Postby AvtBenelux » Tue Feb 21, 2012 3:03 pm

Any suggestion how I can refresh the parent page when someone clicks the close button (I need it only on sertain popup's)?
I have pictures of products in my shop that that can be viewed with the pop-up but when you close this pop-up it does not need to refresh the parent page, but when someone buys a product it shows the shopping cart content in the pop-up. When you change the number of products in the pop-up and close the pop-up on the X, I need to refresh the parent frame as this shows the number of products in the shopping cart and that needs to be updated by refreshing the parent page.

In short, Can I some code to the pop-up activation code that when the pop-up is closed it performs a JS action like refresh parent frame.
AvtBenelux
 
Posts: 2
Joined: Tue Feb 21, 2012 2:40 pm

Re: On submit refresh parent page

Postby RoadRash » Thu Feb 23, 2012 3:21 pm

This code will reload the parent page when you close an HTML popup, but not when you close an image popup:
Code: Select all
hs.Expander.prototype.onAfterClose = function () {
   if(this.contentType == 'html')
   window.location.reload();
};

Note: requires highslide-full.js
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no
User avatar
RoadRash
 
Posts: 8207
Joined: Tue Jul 15, 2008 8:43 pm
Location: Fredrikstad, Norway

Re: On submit refresh parent page

Postby AvtBenelux » Thu Feb 23, 2012 4:56 pm

GREAT!!! THIS WORKS.
You are the best.

thanks for the help
kind regards
dennis
AvtBenelux
 
Posts: 2
Joined: Tue Feb 21, 2012 2:40 pm


Return to Highslide JS Usage

Who is online

Users browsing this forum: No registered users and 3 guests