A Rich Textbox control is generally used for displaying, entering and manipulating text with formatting. The RichTextBox control does everything a textbox control does, but it can also display fonts, colors, links, margins, load text and images from a file. Although it adds more complexity when compared to a regular textbox, it provides much needed features.
The RichTextBox control can be used with any Sharepoint text field, but it order to unlock all its features you have to bind it to a textbox defined with multiple lines of text. It automatically recognizes the type of text allowed with the rich textbox field and enables or disables the features available for use, as shown below:
Multiple line of Text columns with Plain Text mode selected, the RichTextBox control renders as a simple TextBox with no additional options to format text.
For Enhanced rich text columns, the control displays all the available toolbar options.
Provides a unique name for the control.
Indicates if the control is
Sets if the control will be enabled or disabled when the forms handles a new record
Sets if the control will be enabled or disabled when the forms handles an existing record
Marks the cotnrol as Required.
By default, the system recognizes required fields and marks them with this flag. Additionaly, controls can be marked as required event if the bound column is not.
Set an expression then will be evaluated during run-time and enable or disable the control.
The expression must be in javascript and should return a boolean value.
Dependencies between controls are automatically identified and the expression is re-calculated every time a control affecting the formula changes.
Example :
form.GetControl("c_Status").GetValue() != "Open" && form.UserInGroup("Administrators")
Define a valid formula (using javascript) that will be evaluated during runtime to show or hide the control.
The expression should return a boolean value.
For example :
form.FieldValue("c_Status") != "Rejected" || form.UserID() == "1"
This property defines how the control will get its value.
Here are the available options :
A static text must be set in the appropriate designer control.
A javascript expression must be set that will provide the value for the control.
If the formula contains references to other controls, dependencies will be automatically identifies during run-time and the value will be updated to reflect changes.
Example :
form.FieldValue("c_Active") ? "Yes" : "No"
There is an additional option that instructs the form to perform calculations only for new records. Existing records will keep their original value.
A predefined list query is bound to the value of the control. So during form initialization, the specified list query is executed and if it returns any item, it selects the first one and it will apply the value to the label based on the following rule :
If a Field Name has been selected in the corresponding box, that specific column will be used from the list item to fill the control value.
If the Field Name is left blank, the first column retrieved will be used.
The same as above, the required web service is selected and after the web service retrieves data, the first item will be used to update the control value. If no Field Name is set, the control will receive the first field of the retrieved item.
Works the same way ListQueries and Web Service works.
The default value has any effect only of the control is bound to a list column.
For unbound controls, the default value is ignored.
You may set a static value here or use a formula by starting your input with the "equals" (=) sign.
Example :
="User : " + form.UserFullName()
Defines the width of the control.
When the value is zero, the maximum allowed width will be used.
Defines the control height.
If the value is zero, the height property will not be set.
Defines the horizontal alignment of the parent cell (values : left, right, center)
Defines the vertical alignment of the parent cell (values : top, bottom, center)
Not Applicable for the RichTextBox control.
Not Applicable for the RichTextBox control.
Defines the color of the parent cell.
Not Applicable for the RichTextBox control.
Sets the margin applied to the control, that is, the spacing between the control and the cell borders.
Not Applicable for the RichTextBox control.
Not Applicable for this control
When this property is set to true, the Editor's toolbar is hidden by default and is auto-displayed when the control receives focus.
Font names separated by semilocon (;) to be used in the font dropdown list of the rich textbox editor. If empty, the default font list is used.
When this property is set to true, in ViewMode, the control's height is adjusted according to its value.
Sets the script that will be executed at the value-change event of the control.
Example :
var value = form.GetControl("c_Title").GetValue();
if (value == "Open") form.HideSection("Details");
else form.ShowSection("Details");