Link to home
Start Free TrialLog in
Avatar of CodeLover
CodeLover

asked on

How to refresh parent window after submitting from child window?

Hi, all

I am creating a web page. When I click on a button on the page, a new window opens. I use "window.showModelessDialog" to do it. When I enter some text on the new window and submit, the parent window will refresh. Could you please tell me how to do it and give some sample codes? Thanks.
Avatar of Marcuse
Marcuse

I'm confused.

Do you WANT the parent to refresh, or is it a side-effect you DON'T want?

if the text is submitted to the wrong window, try something like using a target="_self_ in your form or <base target="_self"/> in your heading...

B more specific please...

GL
is this what you are looking for?

function submitAndClose(theForm)
{
   theForm.submit();
  window.opener.location.reload()
}

<form name="someForm" action="someAction.asp">
 <input type="text">
 <input type="button" value="submit" onclick="submitAndRefresh(document.forms[this])">
</form>
Avatar of CodeLover

ASKER

Hi, there

I WANT the parent to refresh. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of szczepan
szczepan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial