URL parameters
When you open a form, you can add additional parameters to the URL of the form to prefill some form fields. You need to separate URL parameters from the main URL by adding a question mark ?. If you need multiple parameters, separate them with an ampersand &. This results the following pattern for the URL:
Please note that when you need to use special characters, you need to escape them. For example, to specify an URL parameters named tfCompany with the value Clark & Joe Ltd.:
Using URL parameters
You can use URL parameters to prefill form fields both when the form is opened for the first time as well as when a saved or submitted form is opened again. Please note that existing form field values are overwritten when URL parameters are used.
Examples
Prefilling an input field
Create a input field with the name tfMail. When you open the form, add the URL parameter tfMail and set it to an email address. The URL could look like:
As shown in the figure to the right, this sets the initial value of the input field to the given email address.
Prefilling a select field
You can preselect an option of a select field as well. Note that you cannot use the displayed name as the value of the URL parameter. You need to use the value specified in the values column of the options section in the properties panel of the Xima® Formcycle Designer.
Create a select field with the name selSex. When you open the form, add the URL parameter selSex and set it to f. The URL could look like:
As shown in the figure to the right, this preselects the option female.
Changing the form layout
You can create different form layouts (CSS themes) in the Layout (CSS) menu. You can then assign one form layout to each form. If you want to open a form with a different layout, such as a blue or red variation of your main theme, you can use an optional URL parameter.
The name of the URL parameter is xfc-rp-theme, and its value needs to be the UUID of the form layout. You can view the UUID of each form layout in the Layout (CSS) menu (see screenshot to the right).
For example:
http://<host>/formcycle/form/alias/1/demo?xfc-rp-theme=8b4a9c2d-34d9-4cff-8759-9b54ed4b0ff1