You are here

yamlform.yamlform.example_elements_states.yml in YAML Form 8

modules/yamlform_examples/config/install/yamlform.yamlform.example_elements_states.yml

File

modules/yamlform_examples/config/install/yamlform.yamlform.example_elements_states.yml
View source
  1. langcode: en
  2. status: false
  3. dependencies:
  4. enforced:
  5. module:
  6. - yamlform_examples
  7. uid: null
  8. template: false
  9. id: example_elements_states
  10. title: 'Example: Elements: Condition Logic'
  11. description: 'Examples of elements using conditional logic.'
  12. elements: |
  13. checkbox_example:
  14. '#type': details
  15. '#title': 'Checkbox example'
  16. '#open': true
  17. checkbox:
  18. '#type': checkbox
  19. '#title': 'Please check this box'
  20. checkbox_explain:
  21. '#type': textarea
  22. '#title': 'Please explain why you checked the above box'
  23. '#states':
  24. visible:
  25. ':input[name="checkbox"]':
  26. checked: true
  27. required:
  28. ':input[name="checkbox"]':
  29. checked: true
  30. select_example:
  31. '#type': details
  32. '#title': 'Select with other example'
  33. '#open': true
  34. select:
  35. '#type': select
  36. '#title': 'Please select ''other'' in the below select menu.'
  37. '#options':
  38. 1: One
  39. 2: Two
  40. 3: Three
  41. other: 'Other...'
  42. select_other:
  43. '#type': textfield
  44. '#attributes':
  45. placeholder: 'Enter other...'
  46. '#states':
  47. visible:
  48. ':input[name="select"]':
  49. value: other
  50. required:
  51. ':input[name="select"]':
  52. value: other
  53. select_multiple_example:
  54. '#type': details
  55. '#title': 'Select multiple example'
  56. '#open': true
  57. select_multiple:
  58. '#type': select
  59. '#title': 'Please select ''One'' or ''Two'' in the below select menu.'
  60. '#options':
  61. 1: One
  62. 2: Two
  63. 3: Three
  64. 4: Four
  65. select_multiple_other:
  66. '#type': textfield
  67. '#attributes':
  68. placeholder: 'Enter other...'
  69. '#states':
  70. visible:
  71. - ':input[name="select_multiple"]':
  72. - value: 1
  73. - or
  74. - ':input[name="select_multiple"]':
  75. - value: 2
  76. required:
  77. - ':input[name="select_multiple"]':
  78. - value: 1
  79. - or
  80. - ':input[name="select_multiple"]':
  81. - value: 2
  82. radios_example:
  83. '#type': details
  84. '#title': 'Radio buttons with other example'
  85. '#open': true
  86. radios:
  87. '#type': radios
  88. '#title': 'Please select ''other'' from the below radio buttons.'
  89. '#options':
  90. 1: One
  91. 2: Two
  92. 3: Three
  93. other: 'Other...'
  94. radios_other:
  95. '#type': textfield
  96. '#attributes':
  97. placeholder: 'Enter other...'
  98. '#states':
  99. visible:
  100. ':input[name="radios"]':
  101. value: other
  102. required:
  103. ':input[name="radios"]':
  104. value: other
  105. checkbox_more_example:
  106. '#type': details
  107. '#title': 'Checkbox with more information example'
  108. '#open': true
  109. checkbox_more:
  110. '#type': checkbox
  111. '#title': 'Please check this box to enter more information'
  112. checkbox_more_details:
  113. '#type': 'details'
  114. '#title': 'More information'
  115. '#open': true
  116. '#states':
  117. expanded:
  118. ':input[name="checkbox_more"]':
  119. checked: true
  120. checkbox_more_first_name:
  121. '#type': textfield
  122. '#title': 'First name'
  123. '#states':
  124. required:
  125. ':input[name="checkbox_more"]':
  126. checked: true
  127. checkbox_more_last_name:
  128. '#type': textfield
  129. '#title': 'Last name'
  130. '#states':
  131. required:
  132. ':input[name="checkbox_more"]':
  133. checked: true
  134. filled_example:
  135. '#type': details
  136. '#title': 'Text field filled example'
  137. '#open': true
  138. filled:
  139. '#type': textfield
  140. '#title': 'Fill in the below text field to enable and require the next text field.'
  141. filled_next:
  142. '#type': textfield
  143. '#title': 'The next text field'
  144. '#states':
  145. enabled:
  146. ':input[name="filled"]':
  147. filled: true
  148. required:
  149. ':input[name="filled"]':
  150. filled: true
  151. css: ''
  152. javascript: ''
  153. settings:
  154. page: true
  155. page_submit_path: ''
  156. page_confirm_path: ''
  157. form_submit_label: ''
  158. form_submit_attributes: { }
  159. form_exception_message: ''
  160. form_closed_message: ''
  161. form_confidential: false
  162. form_confidential_message: ''
  163. form_prepopulate: false
  164. form_prepopulate_source_entity: false
  165. form_novalidate: false
  166. form_unsaved: false
  167. form_disable_back: false
  168. form_autofocus: false
  169. form_details_toggle: false
  170. wizard_progress_bar: true
  171. wizard_progress_pages: false
  172. wizard_progress_percentage: false
  173. wizard_next_button_label: ''
  174. wizard_next_button_attributes: { }
  175. wizard_prev_button_label: ''
  176. wizard_prev_button_attributes: { }
  177. wizard_start_label: ''
  178. wizard_complete: true
  179. wizard_complete_label: ''
  180. preview: 0
  181. preview_next_button_label: ''
  182. preview_next_button_attributes: { }
  183. preview_prev_button_label: ''
  184. preview_prev_button_attributes: { }
  185. preview_message: ''
  186. draft: false
  187. draft_auto_save: false
  188. draft_button_label: ''
  189. draft_button_attributes: { }
  190. draft_saved_message: ''
  191. draft_loaded_message: ''
  192. confirmation_type: page
  193. confirmation_message: ''
  194. confirmation_url: ''
  195. confirmation_attributes: { }
  196. confirmation_back: true
  197. confirmation_back_label: ''
  198. confirmation_back_attributes: { }
  199. limit_total: null
  200. limit_total_message: ''
  201. limit_user: null
  202. limit_user_message: ''
  203. entity_limit_total: null
  204. entity_limit_user: null
  205. results_disabled: false
  206. results_disabled_ignore: false
  207. token_update: false
  208. access:
  209. create:
  210. roles:
  211. - anonymous
  212. - authenticated
  213. users: { }
  214. view_any:
  215. roles: { }
  216. users: { }
  217. update_any:
  218. roles: { }
  219. users: { }
  220. delete_any:
  221. roles: { }
  222. users: { }
  223. purge_any:
  224. roles: { }
  225. users: { }
  226. view_own:
  227. roles: { }
  228. users: { }
  229. update_own:
  230. roles: { }
  231. users: { }
  232. delete_own:
  233. roles: { }
  234. users: { }
  235. handlers: { }