Muliple links to same form on a single web-page with varying parameters.

  • Profile Image
    Norman Rouxel 
    Asked on October 08, 2019 at 04:40 AM

    I have a client using a feedback form that is opened in a lightbox via new JotformFeedback(...).

    It's a product site and he has multiple products on a page and want to use Jotform as a "Request a Sample" capability.

    He wants to have multiple links to open this form per product on a page and to pre-populate a form field via iframeParameters to pre-set each form submission with different details depending on the product specific link clicked. 

    If I try to call new JotformFeedback(...) more than once I end up with a single form that initially appears empty and when its close button is pressed it displays repeated content.

    Is there a way I can have multiple links to the same form on a page, each with different iframeParameters?

  • Profile Image
    Kiran
    Answered on October 08, 2019 at 05:04 AM

    Could you share the webpage where the form is embedded so that we can check and assist you further?

  • Profile Image
    Norman Rouxel 
    Answered on October 08, 2019 at 07:51 AM
    Hi, Kiran

    Website using this (but with the workaround below is) http://www.drillpine.biz/v18-testsite/acatalog/Necklaces.html
    The “Request a Sample” links are the ones that fire JotForm.

    Problem is marked in red this code in form.jotformeu.com/static/feedback2.js

    setLinkListener:function(){
    var linkIdentifier='lightbox-'+this.options.formId;
    var $this=this;
    $jot("."+linkIdentifier).each(function(){
    $jot(this).click($jot.proxy($this.showWindow,$this));
    });
    $jot('#'+linkIdentifier).click($jot.proxy(this.showWindow,this));
    }

    This requires each link that uses the same form to have identical classnames and this ends up erroneously grouping the forms.

    My workaround is to use links like:

    Request a Sample

    And amending new JotformFeedback to add a parameter anc:

    And amending feedback2.js to use:

    setLinkListener:function(){
    var linkIdentifier='lightbox-'+this.options.anc;
    var $this=this;
    $jot("."+linkIdentifier).each(function(){
    $jot(this).click($jot.proxy($this.showWindow,$this));
    });
    $jot('#'+linkIdentifier).click($jot.proxy(this.showWindow,this));
    }

    I hope you understand the above and can provide a solution that doesn’t require modifying your code.



    Norman
    _____________________________________________

    Drillpine Ltd
    25 Sunbury Street, Edinburgh, UK.
    Registered in Scotland #SC097748.
    VAT registration number 429 4887 04.
    ______________________________________________



    ...
  • Profile Image
    jherwin
    Answered on October 08, 2019 at 08:21 AM

    Actually, the workaround you created was the solution if you are embedding multiple feedback forms on the same webpage. This is due to the fact that your page/button makes multiple calls to the same JavaScript file if you do not change the code of the other feedback form.