当表单加载时,所有标记为必填的字段都为红色,因为它们是空白的。如果/当有人离开特定字段时,我如何更改它以便它们仅变为红色(检查验证)。这是特定于羊驼毛的形式。
$(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
},
}
}
});
});
Run Code Online (Sandbox Code Playgroud)