How Can I Configure a Lighbox Form to Automatically Close Upon Submission?
-
abhijitAsked on March 24, 2013 at 02:11 AMThe above code works perfectly, buy if I click outside the form anywhere on the page the form disappears. Is it possible that the form should disappear only when someone fills in the details and click on submit button?
This is a re-post of a comment on How to Auto-popup a Lightbox Form
-
WelvinAnswered on March 24, 2013 at 02:13 AMJotform Support
Hi,
Unfortunately, that is how it works and the window will also not close after hitting the submit button. You will have to click the "X" button to close the window.
Thanks
-
abhi002011Answered on March 26, 2013 at 01:24 AM
So is there any other code available wherein the form will only disappear when somebody clicks on submit button? Any other option possible??
-
abajanAnswered on March 26, 2013 at 06:29 AM
The code provided by the Embed Form Wizard can be edited to prevent closure when the user clicks outside of the lightbox but having it close upon submission would require downloading the form files (see step 4 of this guide) and editing the form's script. Of course, the $64,000 question is what to change in the script! However, I will submit a ticket requesting that a parameter similar to openOnLoad:true (perhaps closeOnSubmit:true) be made available, so there would be no need to download and tinker with the form script.
In the meantime, to prevent closure when outside of the lightbox is clicked, remove the "2", highlighted below, from the src attribute of the lightbox code:
http://cdn.jotfor.ms/static/feedback2.js?3.1.2371
If you need further help, please let us know.
Thanks.
-
abhi002011Answered on March 26, 2013 at 04:02 PM
Great!! Abajan... Sir!! it worked for me. I just edit the code as you told and now the form doesnot disappear when somebody clicks outside the form on the page! So one worry for me is over . Now the second part, can you please provide me the code or any other solution so that the form is closed only when someone clicks the "submit" button. Also is there any way the "X" (close) button is removed or disabled? I want the form to be closed only when somebody fills in the form and click on "submit" button. My requirement is when a visitor browse my site and lands up to a particular page he/she has to fillup the form and only then the content on the page will be visible. No other way to close the lightbox form.
Sir once again THANK YOU for your reply and solution to my query.
Thanks
-
abajanAnswered on March 26, 2013 at 11:41 PM
@abhi002011
There may be a workaround (as indicated by our colleague fxr in this thread) but I haven't come up with anything as yet.
-
michaelbay123Answered on March 02, 2014 at 08:30 AM
put this code between <head> to make 'x' button disappear
<style>
div.jt-feedback.ui-draggable div.jt-title div {
display:none !important;
}
</style>
-
ChriistianAnswered on September 28, 2015 at 06:10 AM
Hi yogesh1ag,
I have moved your question to a separate thread to we can better assist you. You can check it here. We will attend to your concern on that thread as soon as possible.
If you have any further question, please feel free to contact us again by creating a new thread.
Regards.