[英]Alpaca Forms validation show error message only after user leaves field (leaves the field)
All the fields marked required are in red when the form loads since they are blank. 标签所需的所有字段在表单加载时都是红色的,因为它们是空白的。 How do I change this so that they only turn red (check validation) if/when someone leaves a particular field.
如果/当有人离开特定字段时,如何更改此设置以使它们仅变为红色(检查验证)。 This is specific to Alpaca forms.
这是羊驼形式特有的。
$(document).ready(function() {
$("#form").alpaca({
"schema": {
"title":"User Feedback",
"description":"What do you think about Alpaca?",
"type":"object",
"properties": {
"volunteer_name": {
"type":"string",
"title":"Name of Civic Tutor",
"required":true
},
}
}
});
});
Oh, there's actually a very simple solution to this. 哦,实际上有一个非常简单的解决方案。 Just add a "options": {"hideInitValidationError":true,....} to your form.
只需在表单中添加一个“选项”:{“hideInitValidationError”:true,....}。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.