/
/
/
Fields to be displayed depending on the action

Fields to be displayed depending on the action

How can some form fields be displayed only when editing and others only when creating?

To do this, it is enough to mark fields in the form description with the appropriate remove_if parameters: if new — the field will be displayed only when creating a new item; and edit — only when editing. 

  <metadata name="example.removeif" type="form">
    <form>
      <field name="name" remove_if="edit">
        <input type="text" name="value"/>
      </field>
      <field name="nick" remove_if="new">
        <input type="text" name="value"/>
      </field>
    </form>
  </metadata>

  In this example, the name field is only displayed when creating a new list item, and the nick field is only displayed when editing. Values other than new/edit are ignored.