Documentation > CMS Template API Library > Input > ShowTextBox(String,String,String,Int32,Int32,Int32,String,Boolean,String)

ShowTextBox

Adds a textbox control to the input screen. If the Optional: height, is set to a value greater than 0, ShowTextBox will render a multiline textarea.

public System.Void ShowTextBox(String,String,String,Int32,Int32,Int32,String,Boolean,String)

Parameters

NameDescriptionType
label The label of the field when displayed. System.String
fieldName The field name where the value will be stored. System.String
defaultValue Optional: the default value. System.String
width The # of characters defining the width of the TextBox. System.Int32
height Setting this field to a value greater than 0 will render a multiline textarea. System.Int32
maxLength Optional: adds the maxlength attibute. This will only appear for textboxes System.Int32
helpMessage Optional: help message System.String
readOnly Optional: Make the text box read only. Defaults to false System.Boolean
popupMessage Optional: The popup help message. System.String

Code Example

C#

Sample:

            		
            // Standard Textbox
            Input.ShowTextBox("Title", "title");
            // Standard Texbox with Help (optional parameter)
            Input.ShowTextBox("Short Title", "short_title", helpMessage: "(A short title for your content used in linking and other space-constrained instances.)");
            // Multiline Textbox
            Input.ShowTextBox("Description", "description", "", 50, 10, helpMessage: "Enter a description");
            
            	

Connect with Crownpeak