close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Close onSubmit

Thread began 12/11/2009 2:30 am by Daryl | Last modified 2/02/2010 4:51 pm by Jason Byrnes | 2288 views | 7 replies |

DarylBeta Tester

Close onSubmit

I have a DA form that opens in a lightbox that I would like to close the lightbox after submission.

If I add

parent.location.reload();parent.Shadowbox.close();

to the onSubmit button no data is submitted, I have tried to add this to the redirect url option (just in case) but this didn't work as it was looking for a page with this name.

Does anyone have any suggestions on how I could add this?

Many Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

By using parent.location.reload(), you are reloading the page on the onClick of the button, before the form is submited.

ussusally to open a lightbox, you just change the Display Property from none to block. To close the lighbox, you change the display property from block to none.

I'm not positive, but that may be what parent.Shadowbox.close(); does, try that with out the parent.location.reload() in front of it.

Sign in to reply to this post

DarylBeta Tester

I have tried your suggestion, the lightbox closes but the data isn't submitted to the database.

Is there a way to add this JS to the url part of the redirect rather than in the onclick ?

Sign in to reply to this post

Jason ByrnesWebAssist

maybe set the redirect to <pagename>.php?insert=true


Then add a php if statement to change the <body> tag




php:
<?php if(isset($_GET['insert']) && $_GET['insert'] == "true") { ?>
<body onload="parent.Shadowbox.close();">
<?php } else { ?>
<body>
<?php ?>
Sign in to reply to this post

DarylBeta Tester

Due to restrictions with the DW Template that I was using I created a new blank page with the body tag that you suggested. Then set the form to redirect to the new page.

Works perfectly!

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it is working.

Sign in to reply to this post

DarylBeta Tester

Jason

I am trying to get this working on new website.

When a user succesfully logs in they get redirected to a new page.

I have put the php code on the new page, however the new page loads in the lightbox and then closes the lightbox and the page in it.

I need the lightbox to close and the new page to be visible.

Sign in to reply to this post

Jason ByrnesWebAssist

to be 100% honest, I am not that great with using light boxes. I really canot tell what the problem may be.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...