how can I open a lightbox form directly from javascript ???

  • Profile Image
    hgc2002
    Asked on October 02, 2012 at 10:29 AM

    I'm using lightbox form. The given example works using a anchor like 

    Email Sign-up Form

     

    But know i need to open it when another buttons get into action. I don't see any method to open the form without click in the anchor. I've tried with jQuery triggering click event in the anchor but it fails.

     

    How can I open the form without using the anchor?

     

    Thanks for your time.

     

    Regards,

    Herman

  • Profile Image
    Rodjit
    Answered on October 02, 2012 at 11:41 AM

    Hi Herman,

    You may try placing this codes into your website:

    <script>

             window.open("http://form.jotform.me/form/22686092485463");

                </script>

    <?php } ? >

    Example: http://katipunan.biz/test-popup/

    Please note to change the URL of the form in script.

    Hope this helps. Thanks

  • Profile Image
    abajan
    Answered on October 02, 2012 at 12:22 PM

    Hi Herman

    Notwithstanding that you asked for a solution that doesn't use the anchor, as an alternative, according to Dan Shulz (deceased) in this thread, you could enclose a span within the anchor tags and style it via CSS to look like a button. (Here are some CSS3 examples but your buttons need not be that fancy!)

    It's also possible to have the lightbox automatically open when the page loads (as demonstrated at this link) by adding an openOnLoad: true parameter to the lightbox code. In such cases, the anchor link can be omitted.

    The solution offered in this thread may also be useful.

    Later today, I'll test out Dan's solution later and post a demo here.


    Wayne