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

    Need SKU of product page auto inserted into Jotform or Email Alert

    Asked by advertisingmagnets on May 20, 2014 at 10:58 AM

    I have the same form on around 80 product pages of my website. Is there anyway I can use Jotform to retrieve the product/sku the customer is looking at when they choose to fill out my form?

    On a custom made form my site used prior to jotform, the product SKU of the product page the customer was on, was automatically put in the Subject line of the email sent to me.

     

    Thanks

    Page URL:
    http://promotionalpencils.biz/index.php/best-pencil-value.html

    JotForm email product site
  • Profile Image
    JotForm Support

    Answered by ashwin_d on May 20, 2014 at 12:14 PM

    Hello advertisingmagnets ,

    Do you mean to say that you want to display the product user input in "SKU/Product Name" field in the subject line of your submission email?

    Yes it is possible to achieve your requirement. You need to simply add the "Field Name" in the subject linke of your email template. Please check the screenshot below for the process :

    Hope this helps.

    Do get back to us if you meant to ask something else.

    Thank you!

  • Profile Image

    Answered by advertisingmagnets on May 20, 2014 at 01:59 PM

    Thanks for the help.

    We actually need the form to auto fill the SKU rather the customer having to locate the SKU themselves. They seem to always have a hard time locating it.

    Somehow our previous form (not a jotform), grabbed the SKU from the page and inserted it into the email that came to us. That's what we're hoping for.

  • Profile Image
    JotForm Support

    Answered by KadeJM on May 20, 2014 at 02:55 PM

    I think there may be a slight chance of this being a possibility, but it will be a little bit tricky because of trying to get the form to recognize the data including saving and displaying it to users. However, we are willing to try but i'll need some clarity on a couple things first.

    One - I see you have a form on your website that is not from JotForm. Is that the form you were wanting to pull the sku's from? Or are they cataloged on your backend probably more likely the case?

    Two - It appears that you are using Magento maybe? Is that correct? As far as I know it looks like they allow the use of PHP which should work sending the sku'd data. We can try to have a script so that the form pulls that data perhaps so its worth a few tries at least to see if we can get this working for you.

    Also, It's rather likely that this is going to end up using the form's full source code in order for this to work this way.

  • Profile Image

    Answered by advertisingmagnets on May 20, 2014 at 10:05 PM

    Hi KadeJM,

    On your first question.....the SKU's would be pulled from the backend, but I should have made it clearer, if we get this working, I will delete the jotform option for the customer to input the product SKU themselves.

    Also, FYI, the jotform I have been referring to is located by clicking on the REQUEST A PROOF button under the product image here: http://promotionalpencils.biz/index.php/best-pencil-value.html Sorry if I didn't make that clear before.

    On your second question, yep..it's a magento store. Also, I've been using the form's full souce code already. 

    Lastly, below is the code of the previous form that somehow sent the product sku, via email, to me, along with the mailer.php it was using.

    Thanks and you are a great help.

    FORM
    -----------------------------------------------

    http://pastiebin.com/537c5728cd862

  • Profile Image
    JotForm Support

    Answered by jonathan on May 21, 2014 at 05:04 AM

    @ advertisingmagnets

    It is possible to pre-populate the lightbox form by using the URL paramters value.
    If you test the lightbox form, the SKU field is auto populated by a value coming from a script variable. Is this applicable to what you need?
    Please inform us if you need further assistance on this.
    Thanks!
  • Profile Image

    Answered by advertisingmagnets on May 21, 2014 at 12:02 PM

    Jonathan,

    I followed the guide and when I use this it works with the SKU field prepopulated with the word SKU, just as your example.

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

    new JotformFeedback({

    formId:'41116274724147',

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

    windowTitle:'Proof Request',

    iframeParameters: {

         'skuproductName': 'variable1'

    },

    background:'#FFA500',

    fontColor:'#FFFFFF',

    type:false,

    height:500,

    width:700

    });

    </script>

    <a class="lightbox-41116274724147" style="cursor:pointer;color:white;text-decoration:none;">Request A Proof</a>

     

    But when I use the below code for the variable, trying to get the SKU field populated automatically with the actual SKU of the product, the "REQUEST A PROOF" button becomes unclickable. any ideas?

    <script type="text/javascript'>

    var variable1="sku";

    </script>

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

    new JotformFeedback({

    formId:'41116274724147',

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

    windowTitle:'Proof Request',

    iframeParameters: {

         'skuproductName': variable1

    },

    background:'#FFA500',

    fontColor:'#FFFFFF',

    type:false,

    height:500,

    width:700

    });

    </script>

    <a class="lightbox-41116274724147" style="cursor:pointer;color:white;text-decoration:none;">Request A Proof</a>

  • Profile Image
    JotForm Support

    Answered by Welvin on May 21, 2014 at 01:33 PM

    You are using ' (apostrophe) instead of " (inverted comma) on the following line of scripts:

    <script type="text/javascript'>

    var variable1="sku";

    </script>

    Please change to fix it.

    Thanks

  • Profile Image
    JotForm Support

    Answered by Welvin on May 21, 2014 at 01:35 PM

    OR, get the entire corrected codes here: http://pastiebin.com/537ce3a1be5a6

    Thanks

  • Profile Image

    Answered by advertisingmagnets on May 21, 2014 at 01:44 PM

    Hi Welvin,

    I used your code.....but now it just prepopulates the field with the WORD sku, instead of the actual product sku.

    On this live page http://promotionalpencils.biz/index.php/best-pencil-value.html, the field should prepopulate with the sku, "BPV"

    Thanks for the help

  • Profile Image
    JotForm Support

    Answered by EltonCris on May 21, 2014 at 03:26 PM

    We'll check this later today and get back to you with a solution, hopefully.

    Can you please confirm if the is the required php script to call the "sku" data?

    echo $this->htmlEscape($_product->getSku());

    Thanks and stay tuned!

  • Profile Image

    Answered by advertisingmagnets on May 21, 2014 at 03:33 PM

    I believe your are correct. That is the correct script.

    Thanks!

  • Profile Image

    Answered by advertisingmagnets on May 28, 2014 at 05:01 PM

    Any support person ever come up with a solution for this?

    Thanks!

  • Profile Image
    JotForm Support

    Answered by EltonCris on May 28, 2014 at 06:17 PM

    @advertisingmagnets

    My apologies for the delay about this. Please try the following:

    <?php 

    $sku = $this->htmlEscape($_product->getSku());

    echo '<script>var sku = "'. $sku.'"</script>';

    ?> 

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

    new JotformFeedback({

    formId:'41116274724147',

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

    windowTitle:'Proof Request',

    iframeParameters: {

         'skuproductName': sku

    },

    background:'#FFA500',

    fontColor:'#FFFFFF',

    type:false,

    height:500,

    width:700

    });

    </script>

    <a class="lightbox-41116274724147" style="cursor:pointer;color:black;text-decoration:none;">Request A Proof</a>

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

    Let us know if this doesn't work on your end. Thanks!