HTML formatting added to labels is being stripped out

  • Profile Image
    BE
    Asked on October 18, 2011 at 11:37 PM

    Hi, this is a fairly minor thing but I've found when working on big forms it can be a major pain ;) Currently if I type in the text for a label and then add html to it, like a <br> tag to format an unweildy label, JotForm strips out my html the next time I edit that label.

    e.g. If I make my label "this is a really <strong>really</strong> <br />really long label"

    The formatting will pick up and it will display on my form as:

    this is a really really
    really long label

    ...until I edit that label again in which case it reverts to:

    this is a really really really long label

    Is there any way around this, or is it already on the JotForm wishlist?

    Thanks guys :)

  • Profile Image
    paoloumali
    Answered on October 19, 2011 at 01:02 AM

    Hi,

     

    Can you point me to the form you're working on? I might be able to suggest a CSS line to make it break on a particular point. Most labels I've found just use text.

     

    If you're doing such process of reducing labels' width for most of your forms, please do below:

    1. Click 'Preferences' in the top bar (under 'Setup and Embed').

    2.  In the dialog that pops up, click 'Field Styles' tab then set the Label Width property to what you desire.

     

    After, please don't forget to inject CSS:

    1. Also under Preferences, go to 'Form Styles' tab

    2. Add below code into 'Inject Custom CSS'

     

    label {

    word-wrap: break-word;

    }

  • Profile Image
    BE
    Answered on October 19, 2011 at 01:21 AM

    Hi, sure thing, the form is here - https://www.jotform.com/form/12764908762

  • Profile Image
    paoloumali
    Answered on October 19, 2011 at 01:43 AM

    Thanks.

    I think the tags is solved by my post above but for any other html tags that should be remembered, we will need to wait a word from our developers. I really am not sure if the labels were really constrained to texts only. I am creating a ticket for this.

  • Profile Image
    BE
    Answered on October 20, 2011 at 01:43 AM

    Thanks for your help and for creating a ticket, it would certainly save time if the labels could remember their formatting.

    Thanks again :)

  • Profile Image
    aytekin
    Answered on October 20, 2011 at 05:12 AM

    Unfortunately, we cannot implement your request. Since HTML code can be used to make cross site scripting attacks.

    If you need to customize the form code further, our recommendation would be to copy the full form source code to your web site, and edit it there. Here is how you can get it. Open your form on the Form Builder:

    1. Open "Setup & Embed" tab on toolbar,

    2. Click on "Embed Form"

    3. Click on "Source" and copy the HTML code provided to your web site..