首页 > 解决方案 > 如何隐藏 FormIO 中的警报危险?

问题描述

我在 Angular 7 中使用 FormIO,如果它无效,我不想在我的表单中显示包含“Societe est obligatoire”的警报危险(第一个)。

在此处输入图像描述

这是我在 form-io.component.ts 中声明的表单

form= {
components: [
  {
      type: "textfield",
      input: true,
      tableView: true,
      inputType: "text",
      inputMask: "",
      label: "Societe",
      key: "societe",
      placeholder: "societe",
      multiple: false,
      defaultValue: "",
      protected: false,
      unique: false,
      persistent: true,
      validate: {
          required: true,
          minLength: 1,
          pattern: "",
          custom: "",
          customPrivate: false
      },
      conditional: {
          show: "",
          when: null,
          eq: ""
      }
  },
  {
    input:true,
    label:"Validate",
    tableView:false,
    key:"ValidateFournisseur",
    size:"md",
    block:false,
    action:"submit",
    disableOnInvalid:true,
    theme:"primary",
    type:"button",   
    hidden:false 
  } 

这是我的 form-io.component.html

<formio [form]="form"></formio>

有什么帮助吗?

标签: angularformio

解决方案


对于那些仍在寻找答案的人

在你的 html

<formio [form]="form" [options]="options" ></formio>

在你的 ts 文件中

options: Object = {
  submitMessage: "",
  disableAlerts: true,
  noAlerts: true
}

希望能帮助到你


推荐阅读