Custom Form Fields

Overview.

Custom form fields facility allows you to manage user, listing, review, message and widget form fields via administrator panel.

It is possible to set field validation rules, predefine options for multi-choice fields, enable listing fields to be searchable.

You can control the field visibility by linking it to listing type products and categories. This option is available for listings, reviews and messages.


Field Name, Label, Description and Placeholder.

Field label is a descriptive word or phrase that appears to the left of the field.

Field name is usually a lower case alphanumeric representation of the label. No spaces or extra symbols are allowed. Use "acceptedcurrencies" for the label of "Accepted Currencies".

Field description is placed below the field and may include detailed description of the expected value or other field instructions.

Field placeholder appears as a short hint in the input field before user enters a value. Placeholder is supported by Email, Number, Phone, Price, Text, Textarea, Website URL and YouTube field types.


Field Types.

The following field types are supported:

CheckboxLets user select one or more values of a predefined list of options.
ColorHEX color picker.
DateA javascript-based locale-dependable date picker.
DatetimeIs similar to "Date" but includes time setting.
FileAn advanced drag-and-drop implementation of the file upload form field.
Email 
Opening Hours 
HTML TextareaAn WYSIWYG text input.
KeywordsA comma separated keywords list.
Multiple Select 
NumberThis field accepts integers and decimals. Transforms values according to the user localization.
Phone 
PriceSupports decimal values with two digits after the decimal point.
RadioIs similar to the "Checkbox" field but allows one selection only.
RatingA star rating picker. Accepts a range of 0 to 5 with the step of 0.5.
Dropdown / Select 
SeparatorIs used to visually separate fields in the form.
TextA single-line text input.
TextareaA multi-line text input field.
Time 
Timezone 
ToggleA two-state switch that can be enabled or disabled.
Website URL 
YouTubeThe field accepts a YouTube video URL.

 

Validation Rules.

One or several validation rules can be applied to any custom form field.

Some of the fields have a built-in value validation: Color, Date, Datetime, Email, Number, Phone, Price, Rating, Time, Timezone, Website URL, YouTube.

Most of the rule names are self-explanatory.

 

Validation Rules Compatibility.

FieldCompatible Rules
CheckboxLength, Maximum Length, Minimum Length, Required.
ColorRequired.
DateRequired.
DatetimeRequired.
FileRequired File.
EmailBanned Words, Length, Maximum Length, Minimum Length, Required.
Opening Hours 
HTML TextareaBanned Words, IP Address, Length, Maximum Length, Minimum Length, Required.
KeywordsBanned Words, Length, Maximum Length, Minimum Length, Required.
Multiple SelectLength, Maximum Length, Minimum Length, Required.
NumberLength, Maximum Length, Minimum Length, Maximum Numeric Value, Minimum Numeric Value, Required.
PhoneBanned Words, Length, Maximum Length, Minimum Length, Required.
PriceLength, Maximum Length, Minimum Length, Maximum Numeric Value, Minimum Numeric Value, Required.
RadioRequired.
RatingRequired.
Dropdown / SelectRequired.
Separator 
TextBanned Words, IP Address, Length, Maximum Length, Minimum Length, Maximum Numeric Value, Minimum Numeric Value, Required.
TextareaBanned Words, IP Address, Length, Maximum Length, Minimum Length, Maximum Numeric Value, Minimum Numeric Value, Required.
TimeRequired.
TimezoneRequired.
ToggleRequired.
Website URLBanned Words, Length, Maximum Length, Minimum Length, Required.
YouTubeRequired.

Please note that Length, Maximum and Minimum Length rules will control the number of characters for a text field and the number of selected values for a multi-choice field.


Validation Rule Parameters.

Some of the validation rules require one or multiple comma separated parameters:

RuleParameter TypeParameter Description
LengthIntegerThe exact number of characters or selected choices required. E.g: 255
Maximum LengthIntegerThe maximum number of characters or selected choices allowed. E.g: 255
Minimum LengthIntegerThe minimum number of characters or selected choices allowed. E.g: 3
Maximum Numeric ValueIntegerThe maximum integer value allowed. E.g: 500
Minimum Numeric ValueIntegerThe minimum integer value allowed. E.g: 1
Unique ValueMixedPerforms a database table lookup to make sure the inserted value is unique. Requires at least 2 paramaters: a database table name that uses the standard script prefix and a table field name to check. Third parameter is available if you want to skip one record by its ID, e.g.: the following parameter will lookup the 'first_name' field in the 'users' table to make sure the name is unique: users,first_name. You can add an id to this parameter to skip the user record with id 1, e.g.:  users,first_name,1

Banned Words may be edited under "Administrator - Settings - Settings - Other - Banned Words". Place one word or phrase per line.

 

Field Options.

Custom form fields of "Dropdown / Select", "Multiple Select", "Checkbox" and "Radio" types require a predefined list of options.

Each option requires a unique key. Usually option key is a lower case alphanumeric representation of the value. E.g: use "airconditioned" as a key for the value of "Air-conditioned".

 

System Form Fields.

There are some predefined form fields required for the script to function properly. Those fields can not be removed, limited or disabled but can be edited to change the field label and field position in the form.

Below is the list of system fields for different form types:

Form TypeSystem Fields
UserFirst Name, Last Name, Email, Password, Address, Zip, Location, Latitude, Longitude, Map Zoom, Timezone
General ListingTitle, Slug, Summary, Description, Address, Zip, Location, Latitude, Longitude, Map Zoom, Meta Title, Meta Keywords, Meta Description, Timezone
Event ListingGeneral Listing + Event Start Date, Frequency, Interval, Weekdays, Weeks, Event Custom Dates, Event End Date, Allow RSVPs
Offer ListingGeneral Listing + Offer Start Date, Offer End Date, Item Price, Discount Type, Discount Value, Available Offers, Offer Terms and Conditions, Allow Redeeming
ReviewTitle, Review
MessageSubject, Message

 

Searching Fields.

Listing form fields can be searchable and appear in the "Refine Filters" form on the listing search results page.

To make the field searchable you have to enable the "Searchable" option.

Depending on the field Search Type there are three possible search scenarios:

"Exact Value Match" - will look for the exact value match.

"Partial Value Match" - will look for partial matches.

"Range" - converts fields of "Price" and "Number" types into a numeric range field in the 'Refine Filters' form.
You can set the minumum and maximum value and the step.

 

Limiting Field Visibility.

"Show on Submit Form" and "Show on Update Form" options restrict the field to appear on submission or update form only.

The field visibility on the listing detailed page and the listing search results page is controlled by "Show on Template" and "Show on Search Results Template" options.