/
SetFieldTypeByRole Method

SetFieldTypeByRole Method

What it Does

Sets the type of all fields having a certain role. Usually fields are defaulted to textboxes, radio buttons or checkboxes. With this method, you can make a field be a DropDownList (select), a multiline field (textarea) or other types.

Parameters

Parameter

Type

Description

RoleStringThe role of the field to be applied a type. E.g "1own"
FieldTypeAbstractFieldTypeBase class representing a type. The child classes that can be used are described below, and can be retrieved using the FieldType module / static class, which has one method per available field type.


FieldType options

Type

ParametersDescriptionSample Code
AltDataButton

valueList:List<string> → list of Level2 + Level 3 field parts that will cover the button. E.g: New List(Of String)({"LName", "FName"}))

Adds an alt data button ( + ) next to the fieldobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.AltDataButton(New List(Of String)({"LName", "FName"})))
DropDownListvalueList:List<string> → list of options to be built within the select tag. Each item will be both the value and the text of the html option tagConverts the field (usually textbox) into a select elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.DropDownList(New List(Of String)({"NY", "CA", "NV"})))
MultiLineNo parametersConverts the field (usually textbox) into a textarea elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.MultiLine())
Range

minValue:int → lower bound of the range

maxValue:int → upper bound of the range

Converts the field into a range elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.Range(1, 100))
MonthNo parametersConverts the field into a month elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.Month())
WeekNo parametersConverts the field into a week elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.Week())
TimeNo parametersConverts the field into a time elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.Time())
DateTimeNo parametersConverts the field into a datetime elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.DateTime())
DateTimeLocalNo parametersConverts the field into a datetimelocal elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.DateTimeLocal())
FTDateNo parametersConverts the field into a date elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.FTDate())
EmailNo parametersConverts the field into an email elementobjQFE.SetFieldTypeByRole("1own", QuikFormsEngine.FieldType.Email())

Related content

SetFieldTypeByFieldName Method
SetFieldTypeByFieldName Method
More like this
How Do I Add Dropdown Lists to a Form?
How Do I Add Dropdown Lists to a Form?
More like this
Configuring Alternative Data Buttons
Configuring Alternative Data Buttons
More like this
SetCustomFieldEditor Method
SetCustomFieldEditor Method
More like this

For help regarding Quik! Forms and the Quik! API
Email: support@quikforms.com | Phone: (877) 456-QUIK