REDCap Custom HTML

Purpose: A place to store some examples of custom HTML for enhancing forms and survey.

=============================================================================================================

Class Colors

REDCap's css includes some familiar background-colored warning boxes. Here is an example where a descriptive text question is used as a warning when someone tries to collect another time point in a longitudinal study without checking the enrollment status of the participant first. The code presented below is placed in the Field Label column (column E) in your data dictionary, or the Field Label box in the Online Designer.

The code looks like: (please note that the code should all be place as a single line)

<div class="red" style="text-align:center;">
<h3 style="text-align:center;">Participant is not ACTIVE</h3>
Please review participant status form before continuing.
</div>

Copy and paste the code below directly in the Field Label cell or your Online Designer
<div class="red" style="text-align:center;"><h3 style="text-align:center;">Participant is not ACTIVE</h3>Please review participant status form before continuing.</div>

You can also use "yellow" and "green", and maybe others.

=============================================================================================================

Highlight a sub-section within a larger section

This can be used to highlight or distinguish sub-sections within a larger section, without using the Section Header column. This is a 'descriptive' field.

The code looks like:

 

<table width="100%" bgcolor="CCFFCC"><tr><td>OCT Tumor</td></tr></table>

You can use standard colors ("red", "yellow", "green", "blue", etc.), or hexadecimal color codes (link to more html colors)

=============================================================================================================

Smaller italic text for additional data in a question

Here is a common one for adding some meta-data to a question.

The code looks like:

Were antiplatelet drugs begun on any day prior to the procedure date listed above?
<span style="font-weight: lighter; font-style:italic;">(your text here)</span>

=============================================================================================================

Text in a box and colored, centered, larger text using H3

The code looks like: (with some extra carriage returns so it doesn't scroll so far to the right)

<p style="border:1px solid black;padding:2px;">
<span style="display:block;border:1px solid grey;padding:10px;font-size: 125%;">
I am going to ask you a few questions to determine whether you are eligible to be in the study. 
<span style="font-weight: normal; font-style:italic;">
[Interviewer: Ask all questions without stopping until you reach "Determine Eligibility before continuing!"]
</span></span></p>
<h3 style="text-align: center; color: #800000;">Identifying Information</h3>
1. Name:

=============================================================================================================

Navigate space