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. Well, you can grant yourself and your users the ability to include HTML code that lets you enhance a text field with decorative formatting and other fancy web code elements. You can even make formatting conditional by combining HTML with the QuickBase formula language.

Note: You can't use HTML codes in text - multiple choice type fields.

HTML codes work only in the following fields:

To allow HTML tags in a text field:
  1. Create or select a text field or text formula type 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 code. In edit mode, the field is in "code view" and you can enter HTML tags. The HTML code shows up anytime you or another user edits the record. In display mode, QuickBase treats the field like a web page. Codes are hidden and field content shows up in whatever format your HTML code specifies.

Example: The following images show how to enter HTML code in an edit form (left) to set formatting. When you display 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 text formula type field

Not only can you use HTML codes to format text in a regular text field, but you can also use them in a formula - text type 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 code with the QuickBase formula language, treat the HTML as you would any text literal within a formula.

Sample Text Formulas with HTML:

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 value from 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 HTML tag within Quotation marks. The code and its contents are a text literal within the formula.

Wherever 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 custom hyperlink that uses text from another field called Title to serve as the link text.

"<a href=\"https://myaccount.quickbase.com/db/DBID?a=dr&amp;rid="&[Record ID#]& "\">" & [Title] & "</a>"

You must replace DBID with the actual dbid of your table. (Read how to find the dbid). HTML demands that the destination of this hyperlink 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-2014   Intuit Inc.  All rights reserved.  Legal Notices.