From version < 4.1 >
edited by awa
on 09.04.2019, 16:13
To version < 7.1
edited by fse
on 16.07.2021, 13:25
<
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Hidden input fields
1 +Variables tab
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.awa
1 +XWiki.fse
Content
... ... @@ -1,24 +1,23 @@
1 -This tab allows you to create input fields that are hidden from the user. They can be used, for example, for transmitting or saving data generated via Javascript.
1 +{{figure image="designer_advanced_variables_example.png"}}
2 +Add hidden input fields in the variables tab. You can use them for data that should not be visible in the form, but needs to be accessed on the server or via JavaScript.
3 +{{/figure}}
2 2  
3 -When necessary, hidden input fields can be made available only on the server, such that they cannot be read from and written to on the client's browser. You can also enter a default value for each hidden input fields in the last column.
5 +The variables tab of the {{designer/}} lets you add additional form, invisible fields. These are never shown in the form. They can be accessed on the server (plugins, workflow actions) or via JavaScript.
4 4  
5 -{{figure image="129En.png" width="300"/}}
7 +We distinguish between two different types of variables:
6 6  
7 -These hidden input fields are implemented as a {{code}}<input type = "hidden">{{/code}} element.
9 +* Server-only variables: They are never available in the browser and cannot be accessed from JavaScript. You can only use them on the server, eg. with plugins or workflow actions.
10 +* Server and client variables: They can be accessed from JavaScript and are also available on the server. This creates hidden input fields in the form: {{code language="none"}}<input type="hidden">{{/code}}
8 8  
9 -Like normal input fields, these can be addressed by their name and their values can be changed. Server side hidden input fields need to be addressed by their alias, which may be different from their name.
12 +Just as with normal form fields, you can access variables by their name. On the server, you need to use the alias instead. To set an initial value for a variable, enter it in the default value column. Finally, you can also [[prefill variables via URL parameters>>doc:Formcycle.FormDesigner.URLParameter]]. The name of the URL parameter must match the name of the variable.
10 10  
11 -Client side hidden input fields can be prefilled by adding URL parameters with the input field's name as the key.
14 +For each variable, you can set the following options:
12 12  
13 -When using the auto complete function in the script tab, hidden input fields are shown in italics.
14 -
15 -For each hidden input field, the following options can be set:
16 -
17 -* Server side only
18 -Whether this hidden input field will not be available on the client side, ie. whether it cannot be accessed via Javascript in the user's browser.
19 -* Name
20 -The name of the hidden input field, as used on the client's side.
21 -* Alias
22 -The name of the hidden input field, as used on the server's side.
23 -* Default value
24 -Default value of the hidden input field.
16 +; Server side only
17 +: Whether the variable is available on the client or not, eg. whether it can be accessed in the browser via JavaScript.
18 +; Name
19 +: The name of the hidden input field, used in the browser to refer to the variable.
20 +; Alias
21 +: The name of the hidden input field, used on the server to refer to the variable.
22 +; Default value
23 +: Default value of the variable.
Copyright 2000-2024