Forums

Problem with a form in a lightbox

schlogo 04 Nov, 2010
Hello

I am trying to setup a form in a lightbox. First test is ok, the only thing is that the error messages appear in a full page of the site... in the lightbox 😲

Would someone know what is wrong? I ve tried many things int he configuration settings in validation , antispam etc .. nothing does the trick

To see by yourself, click the blond girl on the right module

tks !

http://www.paris-diagnostics.com
nml375 04 Nov, 2010
Hi,
Assuming you'd still like to show the error within the lightbox (but without the whole site), add a hidden form input named "tmpl" with the value "component" to your form html.
<input type="hidden" name="tmpl" value="component"/>


/Fredrik

Edit: Corrected the error pointed out by Bob.
GreyHead 04 Nov, 2010
Hi schlogo,

Fredrik has a very good solution there - I never though of that one. One small fix, the name of the hidden input has to be 'tmpl' not 'template'.

Bob

PS A slightly different approach is explained in more detail in Chapter 12 of The ChronoForms Book
nml375 04 Nov, 2010
Hi Bob,
Thanks for pointing that one out.. updated the post accordingly.

/Fredrik
schlogo 05 Nov, 2010
Hello

tks all for your answers, works great. It actually causes another problem. I have a thank you page. Once the form is submitted, it s supposed to close the lightbox and send the user to the thank you page, so google analytics can count . If i use the hidden field, the thanks you page opens... in the lightbox :-/
GreyHead 05 Nov, 2010
Hi schlogo ,

I have a distant memory that this was discussed before in the long lightbox thread here. You might find something useful there.

Off the top of my head I'm not sure how I'd do that. Probably with a pencil and paper and work it through.


Bob
This topic is locked and no more replies can be posted.