What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can't Post response in original question: Pass PHP variables to Light Box

    Asked by Simon Lee on September 02, 2013 at 06:57 PM

    I was trying to respond to: http://www.jotform.com/answers/263034-Pass-PHP-variables-to-Light-Box

     

    However the submit button goes to "Please Wait..." and nothing happens beyond that....

     

    The response I was trying to post is below:

     

    Hi,

     

    You do not need my form, all the code required is above.

     

    It is just a case of resolving how to echo the php variable within the javascript...

    POST variables JotForm style please wait
  • Profile Image
    JotForm Support

    Answered by EltonCris on September 02, 2013 at 10:47 PM

    Hi,

    Yes it should work base on my test. Here's an example:

     

    <?php

    $var = test;

    ?>

    <html>

    <head></head>

    <body>

    <script src="https://www.jotform.com/min/g=feedback" type="text/javascript">

    new JotformFeedback({

    formId:'31840709231954',

    base:'https://www.jotform.com/',

    iframeParameters: {

         'name': '<?php echo $var; ?>'

    },

    windowTitle:'Website error form',

    background:'#000000',

    fontColor:'#FFFFFF',

    type:1,

    height:500,

    width:620

    });

    </script>

    <a id="lightbox-31840709231954" style="cursor:pointer;color:blue;text-decoration:underline;">Website error form</a>

    </body>

    </html>

    I used my form and assigned a text for the variable as an example. You can replace it with get method. Make sure to save this with .php extension.

    Demo: https://shots.jotform.com/elton/test_lightbox_parameter.php

    Thanks!