Use HTML in a Text Field

You get gussied up for special occasions, and you may also want to dress up some text in your QuickBase application. For instance, say you want text in a certain field to be red or bolded red text. In QuickBase, you can grant yourself and your users the ability to include HTML code that lets you include those embellishments. You can even make formatting conditional by combining HTML with the QuickBase formula language.

Note: You can't use HTML in Text - Multiple Choice or Multi-select Text fields.

HTML works only in the following fields:

To allow HTML tags in a text field:
  1. Create or select a Text or Formula - Text field to which you want to add HTML capabilities.

  2. Access the field's properties page.

  3. Within the Text field options section select the Allow some HTML tags to be inserted in the field checkbox.

  4. Click Save.

When you turn on HTML tags within a text field, you and your users can enter regular text and/or HTML. In edit mode, the field is in "code view" and you can enter HTML tags. The HTML shows up anytime you or another user edits the record. In view mode, QuickBase treats the field like a web page. Codes are hidden and field content shows up in whatever format you specified.

Example: The following images show how to enter HTML in the Project Summary field (left) to display a bulleted list. When you view the record, QuickBase shows the beautiful results (right).

What tags are allowed by QuickBase?

You can use HTML tags to format the text field. QuickBase allows you to use only a specific set of HTML tags in your field help. See what tags are allowed in QuickBase.

Using HTML in a Formula - Text field

Not only can you use HTML to format text in a regular text field, but you can also use them in a Formula - Text field to format text. This lets you do things like format and show text differently based on specific conditions. Combining the QuickBase formula language with HTML code can be tricky. When you combine HTML with the QuickBase formula language, treat the HTML as you would any text literal within a formula.

Sample Text Formulas with HTML

If you want to... formula Notes

Show results in blue bold type.

Tip: You can also use HTML tags to color the background of a field.

"<span style=\"color:blue; font-weight:bold\">"& [Subject]&"</span>"

or use the font tag instead:

"<font color=blue><b>" & [Subject] & "</b></font>"

This code displays the text in the Subject field in bold blue format.

Wherever HTML calls for a quotation mark, you must precede it with a backslash ( \ ), so QuickBase does not mistake it for the start or end of a literal in the QuickBase formula language.

Show blue text that says closed when status is complete. Otherwise display bold red text that says "Open".

If([Status]="Completed", "<span style=\"color:blue\">Closed</span>", "<span style=\"color:red; font-weight:bold\">Open</span>")

or, use the less elegant, but still effective:

If([Status]="Completed", "<font color=blue>Closed</font>", "<font color=red><b>Open</b></font>")

Enclose an HTML tag within quotation marks. The code and its contents are a text literal within the formula.

Wherever the HTML calls for a quotation mark, you must precede it with a backslash ( \ ), so that QuickBase does not mistake it for the start or end of a literal in the QuickBase formula language.

Create a link that uses text from another field called Title to serve as the link text.

"<a href=\";rid="&[Record ID#]& "\">" & [Title] & "</a>"

You must replace DBID with the actual dbid of your table and myaccount with your account URL. (Read how to find the dbid). HTML demands that the destination of this link be enclosed in quotation marks. But in the QuickBase formula language, quotation marks signify the start of a literal. So, you must insert a backslash ( \ ) to let QuickBase know that the quotation mark that follows is part of the literal and not an end delimiter of it.

Related Topics:


Return to top   

© 1999-2016  QuickBase, Inc.  All rights reserved.  Legal Notices.