User Defined Fields
With User Defined Fields (UDF) Addon you can define HTML fields which can be used in confirmation form to collect special data from clients.
UDF settings are in WP BASE → Display Settings → UDF and proceed as follows:
Click Add New UDF button. A new empty row will be inserted.
You can add as many records (UDF) as you wish and they will only be saved after you hit Save UDF button which is only visible if there is at least one record added.
Each UDF consists of the following fields:
- ID field: is automatically given by the system and it is unique. You can use this ID in other settings to evaluate submitted values. For example, UDF_1 in email message settings will be replaced by the real value of UDF with ID=1 submitted by the client.
- Name field: You can use anything as the UDF name here, but it is recommended to be unique if you plan to call it in your customization codes using the name, instead of ID.
- Type field: Select type of the form field. In addition to standard HTML fields (text, text area, pulldown menu, checkbox) the following selections are possible: 1) “Phone” will add an input field with phone formatting and validation. 2) “Date” will add an input field with datepicker. Maximum selectable days from today can be entered in options setting. 3) “Function” will add a pulldown menu whose output shall be generated by the custom function entered in Options setting.
- Active field: UDFs marked as active will be displayed in the confirmation form. Check the checkbox of the UDF to make it active. Note: If a UDF is specifically selected in an attribute (e.g. [app_confirmation fields=”udf_1″]), then it will be visible regardless of active setting.
- Required field: Check the checkbox if you want to set filling of the field as mandatory. If a field is set as required and it is visible, client will get a warning message if he submits the field empty.
- Options field:
- For text, textarea and phone fields, this is the placeholder value.
- For pulldown menu, values separated by commas will be your selection options. For example 0-1,1-5,5-10,11+ will create 4 selection options. It is also possible to use CAPACITY placeholder here which will be replaced by capacity of the service: 1-CAPACITY will give selection options from 1 to whatever service capacity is.
- For checkbox, the value entered here is the text beside the checkbox.
- For Date type, this is the maximum number of days selectable in the datepicker counted from today. Negative values are possible, e.g. entering -6575 will only allow picking birthdays for users who are 18 years and older.
- For Function this is the name of the user function that will create pulldown menu html. If function does not exist, an empty html is outputted.
Sorting: On front end items are displayed according to the order here, by default. To make a custom sorting, select the row with your mouse and move it to the new position (drag and drop) and then click Save.
To delete a record empty Name field and Save.
The inserted field will be visible in booking record on Admin Bookings page and you can edit submitted values for each booking there.
After client submits confirmation form, latest UDF values will also be saved as user metas. In their next booking, confirmation form is pre-populated with these values. Client can update these values in Users → Your Bookings page.