Why is my code disappearing?

  • Profile Image
    tada
    Asked on August 31, 2011 at 02:51 PM

    I have created a sign-up for a newsletter/like or follow on social media form.  I have conditions set up to hide or show certain parts of the form depending upon selection from a drop down menu.  If they select email, it shows the email address entry field; if they select facebook, it shows the facebook like box; etc.  The last option on the menu is LinkedIn.  If they select this option, it should show the LinkedIn company profile box, which has a follow button.  I created a free text section of the form and pasted in the html code for the LinkedIn profile box (this is also how I created the sections containing the Facebook like box and Twitter follow button).  Initially, I got it to work (in the preview), but when I tested it on a web page, everything works except that the LinkedIn box won't appear.  So I went back to JotForm to check the code.  When I clicked on Edit HTML for the section that should have had the code for the LinkedIn box, there is nothing there.  I tried adding the code again, and the same thing happened.  The code just disappears from the box.

    Here is the code for the LinkedIn box (hopefully you will see the code itself and not the actual box):

    <script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
    <script type="IN/CompanyProfile" data-id="2300681" data-format="inline"></script>

    How can I make this work?

  • Profile Image
    brx250
    Answered on September 01, 2011 at 01:35 AM

     

    Hi Tada,

    Thank you for using JotForm.

    I've tried reviewing and testing your form and I've noticed that the facebook and twitter share and tweet buttons are working properly. I've come to learn that the script that you are trying to insert is inconsistent which might be the reason why the free text html displays nothing. I suggest you replace the code and try putting it again. You can get the plug-in script here http://developer.linkedin.com/plugins/share-button. Hope this solves your issue.

    If you have any other questions, please feel free to contact us again.

    _____________________________________________  

    Albert  JotForm Support

     

  • Profile Image
    tada
    Answered on September 01, 2011 at 11:37 AM

    Hello Albert,

    Thank you for your quick response.

    I have discovered that the reason may be that the code given by LinkedIn's developer section are scripts.  Apparently JotForm does not allow the use of scripts in the Free Text (HTML) areas, due to security concerns.

    Since I am unable to do what I was trying to do, I have compromised by simply adding a "Follow Us on LinkedIn" button that is linked to the URL of the company page.

  • Profile Image
    brx250
    Answered on September 01, 2011 at 09:40 PM

    Hi there,

    We're glad you've found an alternative to your problem already. I do apologize for forgetting about telling you how JotForm deals with script tags, I was about to update my answer when I've read your new comment. Anyway, yes, scripts are filtered in free text html due to some security reasons. However, you can still achieve what you want by embedding your form's full source code and insert the plug-in script for linkedin. Also, the script you've mentioned earlier has some inconsistent syntax because even when I add it directly to the website's source code, it doesn't do anything. Check the correct script from the link I've provided above. This should work now. 

    If you have further issues and concerns, please feel free to contact us again.

    _____________________________________________  

    Albert  JotForm Support