Hello everyone,
My purpose is to open a webform in a popup window using Popups API module.
- I m using version 6.x-1.3.
- I have already checked the Scan all pages for popup links checkbox in the /admin/settings/popups page.
- Also I changed Content Selector in my theme to #content-content (this div existed already).
I m using a link which has class="popups".
When you click on it a beautiful popup window appears with the webform inside.
If you don't complete mandatory fields the popup window reloads itself with error messages and put in that fields a red border.
So far so good. The webform in popup window works like a usual webform.
When you submit the form , the message goes succefully to the connected with the webform email BUT the popup window close!
I want after submission the popup window to reload itself with the confirmation page inside as it happens with a classic webform.
Notes: I have already try the classes "popups-form", "popups-form-reload", "popups-form-noupdate" which I know that they are irrelevant but just in case..
Also I tried version 6.x-2.0-beta0 but it doesn t work at all. No error messages for empty mandatory fields no email sending.
Can anyone help me with this? I would appreciate any suggestion.
Thank you for your time and sorry my English.
Best regards
John
Comments
Comment #0.0
mponiek commentedSpelling check
Comment #1
vishusrinivasan commentedSame issue here, tried different versions still cant solve it, kindly update here if you find a solution
Comment #2
mponiek commentedI hope that we find a solution because this is kind of emergency.
but I have to say that it was a big surpise this post: http://drupal.org/node/1052060
These people say that version 6.x-2.0-beta0 is working for them. But they have the same problem with confirmation message.
Honestly I tried dozen of times to make that version work but I have never succeeded in it.
Comment #3
vishusrinivasan commented@mponiek even I tried with the version 6.x-2.0-beta0 with the patch mentioned in the post, but no luck. I will try to find a solution, meanwhile if you find one do let me know. Thanks
Comment #4
mponiek commentedI m trying now a solution using lightbox2 but it is very difficult to customize lightframe.
I have searched a lot how to theme lightbox. For now I manage to appear in the lightbox frame only the content of the webform but still I can't change things like background or set min-height or remove imageDataContainer div.
I let u know how I did this, in case you want to give it a shot. These are informations which I got from several links, mostly from http://drupal.org/node/252260.
- I put in my link rel="lightframe[|width:240;]" in order to open the webform with lightbox2. The width is fine but if I put height also e.g. height:240px;, when error messages are displaying the fields are almost disappearing, pushed down, as it excepted. Unfortunately min-height doesn t work here.
-I created a file named simple.tpl.php and i put it in my theme directory. In this file I put the following code:
which prints only the fields of the form and the potential error messages. Of course you can add whatever you want there, like title,links etc. Actually you should start by cutting and paste the code from page.tpl.php of your theme and customize that code.
- In order to make simple.tpl.php file to work I add the following code inside the of my page.tpl.php file (I tried it inside the body and also worked):
AlsoI had to change my href to href="/receive-daily-menu?format=simple". The ?format=simple at the end of the path is necessary in order to trigger the simple.tpl.php file.
- As you see I also created a simple.css file in my theme directory where I meant to put the custom css for this lightframe only. I achieve to theme only couple of things with simple.css BUT I can t theme the lightbox itself as I want.
For example, lightframe has scroll bar for overflowing.When I put
in the simple.css file nothing happens. When I put it in style.css of my theme it works.
Also even in the style.css I can t customize other divs like imageDataContainer(it is the area under the frame which usually contain the data of the image, Download original etc). In fact I want to remove this area (as you can read in the content of the simple.tpl.php I have create a custom close button for lightframe) but the code:
doesn't work neither in simple.css nor in the style.css.
Also I mention that in the simple.css I accomplished to theme only existed divs or classes. The classes close-box and close-text which you can read above are located in the style.css!In the simple.css were not working.
I hope that these informations are helpful for you.
I m still trying to solve the problem with the popups api but I must have an alternative solution, just in case.
Thank you for reading.
And again sorry my english
Best Regards
John
Comment #5
mponiek commentedComment #6
mponiek commentedAT LAST!!!
Thanks to those two posts I found the solution: http://drupal.org/node/491442 and http://drupal.org/node/1052060.
Here is the procedure step by step:
1) - Install Popups API 6.x-2.0-alpha6.
- Enable the module by the module section.
- Go to the /admin/settings/popups and check the box Scan all pages for popup links.
- Go to the /admin/build/themes/settings/[your-theme] and in the textfield Content Selector: replace the existing text with #content-content. If this doesn't work you have add a content div to your theme. Read the file READ.txt from the directory /sites/all/modules/popups for further informations.
2) Open the file popups.module from directory /sites/all/modules/popups and go to the line 134 and replace
this:
with this:
The last snippet makes the error or confirmation messages to appear e.g. in a webform if you don't fill a mandatory field an error message appears. Without the snippet that message doesn't appear in the popup window with the webform. Only the red border of the field appears.
3) Open the file template.php of your theme directory /sites/all/themes/[your-theme]/template.php. At the end of file's code add the following snippet:
ATTENTION: If you ever disable the module you have to remove this snippet otherwise after disabling module you will get a blank page and you wouldn't be able to access module section.
4) Add the webform-popup class to your link, instead of popup e.g.
I hope this helps you.
I won't change the status of the post to Solved unless you confirm me that it works.
P.S. The lightbox method works but I have still problem with the theming of lightframe. And I can't change the url of confirmation page in order to trigger it with the appropriate format.
Comment #7
oshores commentedThans mponiek . It work for me
Comment #8
mponiek commentedComment #9
vishusrinivasan commentedThanks mponiek,
Comment #10.0
(not verified) commentedSpelling check