Forms 如何使用条件隐藏表单中的字段?

Forms 如何使用条件隐藏表单中的字段?,forms,random,typo3,Forms,Random,Typo3,因此,我试图根据以下文档使用变体隐藏表单中的字段: 这是我对表单定义的YAML配置,其中有一个字段需要使用条件隐藏,但它根本不起作用:` 注意:JavaScript不会切换变量的显示状态。页面需要重新加载以切换变体的显示状态。这意味着,您必须自己实现JS,或者在表单中需要多个步骤。 properties: options: Villa: Villa Fritidshus: Fritidshus Bostadsratt: Bos

因此,我试图根据以下文档使用变体隐藏表单中的字段:

这是我对表单定义的YAML配置,其中有一个字段需要使用条件隐藏,但它根本不起作用:`
注意:JavaScript不会切换变量的显示状态。页面需要重新加载以切换变体的显示状态。这意味着,您必须自己实现JS,或者在表单中需要多个步骤。
    properties:
      options:
        Villa: Villa
        Fritidshus: Fritidshus
        Bostadsratt: Bostadsrätt
    type: SingleSelect
    identifier: singleselect-4
    label: 'Ditt/ert boende'
  -
    defaultValue: ''
    type: Text
    identifier: text-9
    label: 'Fastighetsbeteckning vid val Villa'
    variants:
      -
        identifier: variant-1
        condition: 'formValues["singleselect-4"] == "Bostadsratt"'
        renderingOptions:
          enabled: false
  -`