Forum Moderators: open

Message Too Old, No Replies

Open Popup for form, when complete close popup and refresh main window

Need Help

         

JabezDesign

11:55 am on Jan 31, 2006 (gmt 0)

10+ Year Member



I am new to html and javascript, and what I want to do is have a link that users can click on and open a new window, fill out a form that will be in the new window, and when the form is completed and the info is sent, have that new window close auotmatically and have the main window refresh with a message letting users know the info was sent and thanking them for filling out the form.

Does anyone know the javascript codes for this?
Thanks

Dijkgraaf

10:37 pm on Jan 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well what code do you have so far?

You can either open up a new window by the JavaScript window.open, or have a target in the URL e.g. target="newwindowname"

To close the popup window after the submit you would use window.close()
But before you did so you would want to do something like window.opener.location="thankyou.url" in the popup's javascript.

JabezDesign

3:30 am on Feb 1, 2006 (gmt 0)

10+ Year Member



Dijkgraaf says, Well what code do you have so far?

I have no code right now for either the parent or child window.
What do you suggest?

Dijkgraaf

3:38 am on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do a search on some of the methods I mentioned above and you will find code examples you can study.
If you still have questions, than ask a those specific questions.

You will find that people on here are quite willing to help you find bugs in code and suggest improvements, but if you are wanting someone to write you code from scratch you are unlikely to receive much help unless you offer to hire someone to do the work.

rocknbil

8:25 am on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Specifically, search for window.opener. This will lead you to the path of main window refreshment. :-)

Basically when you do a pop-up, the main window is the "opener." Check it out.