我在 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
}
Run Code Online (Sandbox Code Playgroud)
这是我的 form-io.component.html
<formio [form]="form"></formio>
Run Code Online (Sandbox Code Playgroud)
有什么帮助吗?
小智 5
对于那些仍在寻找答案的人
在你的html中
<formio [form]="form" [options]="options" ></formio>
Run Code Online (Sandbox Code Playgroud)
并在 yout ts 文件中
options: Object = {
submitMessage: "",
disableAlerts: true,
noAlerts: true
}
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你