Hi Boris,

    Thanks for your reply. I still got a problem.  I follow the source you
gave,
I did like these:

I give

<script language="javascript">
 function formSubmit(form){
  form.target=window.opener
  form.submit()
  form.close()
 }
</script>
---
<form name="payform" method="post" action="/npd/npdController">
----
<input type="image" border="0" name="saveButton" src="jsp/images/save.gif"
width="71" height="17"  onClick="formSubmit(payform)">
</form>

When I click Save, a new window open and with the result, it not return to
the main window. (my main window have 3 frames)  Then I close
the new window and get a script error msg : Line 21: Object does not support
this property or method.
And line 21 is form.close()


Louis


----- Original Message -----
From: "Boris Erukhimov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 13, 2000 10:32 AM
Subject: Re: [OFFTOPIC] How to control parent window from child window.


> Assuming you are submitting a form saving changes, set  window opener
(parent is
> not valid name in your case) as a  target for the form action property.
After
> submitting of the form close popup window explicitly.
>
> //This is a fragment of your  popup window source
> <script language="javascript">
> function saveChanges(form)
> {
> //Put your form validation here if you need some
>
>   form.target = window.opener;
>   form.submit();
>   window.close();
> }
> </script>
>
> <body>
>   <form name="myForm" method ="post" action="myServletUrl">
>      - - - -
>   <input type="button" value="Save Changes"
onClick="saveChanges(thisform)">
>   </form>
> </body>
>
> Hope it helps
> ~boris
>
>
>
> Louis wrote:
>
> > Hi,
> >     I got a problem, hope someone can help me.
> >
> >     For example, I have a page contain a lists of username & email
address.
> > When user click the username, it will popup
> > a window allow user to change the email address.  If the user save what
he
> > changed, the page will invoke the servlet and
> > do processing and return the result to the jsp page (result show in
parent
> > window).  My problem is how to refresh the parent window and close the
popup
> > window after the servlet process?
> >     I know this can be done, coz I saw JRun JMC using this design, but I
> > don't know how to do it.  Please give me some suggestion.
> >
> > Thanks in advance
> >
> > Louis
> >
> > p/s: IS THERE ANYONE TRY TO FIXING THE JSP-MAILING LIST BUGS?
> >
> >
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to