passing variable to lightbox script works, but form does not resize

  • Profile Image
    Joe
    Asked on August 02, 2012 at 04:12 PM

    I want to use the same lightbox form through all of my sites. 

    However I would like to collect a city variable via a hidden field.

    I have tried to pass the city on the end of the form ID and have made that work by editing the source of the form itself but as soon as I edit the form via the web iterface the server file is recreated? 

    IE: formId:'22130158359.html?city=LA',

    What is the correct way to pass a variable from the source of the lightbox into a hidden field?

  • Profile Image
    Mike_T
    Answered on August 02, 2012 at 05:54 PM

    Thank you for contacting us.

    You can use a method described in the following article:

    Adding parameters in Lightbox and Feedback forms

    However, it works with our Prototype based lightbox code only. When you get your form Lightbox code it looks like:

    < script src="//jotformeu.com/min/g=feedback2" type="text/javascript" >

    ...

    g=feedback2 - means jQuery based lightbox code (it is our updated lightbox code)

    g=feedback - means Prototype based lightbox code (it is the old lightbox code, and it works with added parameters)

    In other words, you will have to change g=feedback2 to g=feedback in your lightbox code to use pre-population method from the mentioned above article.

     

    You can also add a Default Value to your hidden field.

    If you need any further assistance, please let us know.

  • Profile Image
    dcw_web
    Answered on August 06, 2014 at 10:15 PM

    hi the above article is not working for me, i am trying to pass a value to hidden field but on submit its not passing the value to the back end.

    My Code is :

       <script src="//max.jotfor.ms/static/feedback2.js?3.2.3070" type="text/javascript">

    new JotformFeedback({

    formId: 'xxxxxxxxxxx',

    base: 'http://jotform.co/',

    windowTitle:'Registration Form',

    iframeParameters: {

    'q30_pixelCode': 'CC22Jaz'

    },

    background:'#29a949',

    fontColor:'#FFFFFF',

    type:false,

    height:500,

    width:700,

    openOnLoad:false

    });

    </script>

    <a class="lightbox-xxxxxxxxxx"><div class="Button">Register Now</div></a>

     

  • Profile Image
    dcw_web
    Answered on August 06, 2014 at 10:45 PM

    i have made few changes in script tag and its working but now i have a new problem :

    Code changes i have made 

    <script src="//max.jotfor.ms/static/feedback.js?3.2.3101" type="text/javascript"> 

    'pixelCode': 'CC22Jaz'

    the problem is if i use feedback2.js?3.2.3101 then form is re-sizing automatically according to the form fields and window size but the value is not passing through.

    on the other hand if i use  feedback.js?3.2.3101 then value is passing successfully but form dose not authorize and vertical and horizontal scrolls are added to the form.  

    i am looking for a solution in which i can pass the value and form should re-size automatically. 

     

  • Profile Image
    jonathan
    Answered on August 07, 2014 at 06:10 AM

    @ dcw_web

    Hi,

    Can you please share to us the URL of the website where we can check the embedded form and the lightbox code.

    We will be able to figure out a better suggestion if we can check them in actual.

    We will wait for your update.

    Thanks.