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

  • Profile Image
    Simon Lee
    Asked 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...

  • Profile Image
    EltonCris
    Answered 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!