我有一个Alpaca JS表单,其中包含一系列项目,每个项目都包含一个文本框和一个复选框。出于某种原因,当我使用动态控件更改顺序时,它会成功为文本框重新编号,但不会更改复选框的编号。如果按下了相同的顶部按钮以动态添加新字段,这还会导致分配重复的名称。最终结果是提交表单时传递了不正确的数据。如何解决此问题以正确重新编号复选框?
以下是羊驼毛配置的示例:
$("#form1").alpaca({
"schema": {
"title": "Testing checkbox array IDs","description": "Testbox checkbox array test.","type": "object","properties": {
"form-fields": {
"title": "Fields","description": "These are the fields.","type": "array","items": {
"type": "object","properties": {
"field-name": {
"type": "string","title": "Field Name","description": "Enter the name for this field.","required": true
},"field-box": {
"type": "boolean","title": "Field Box","description": "Check this box.","default": false
}
}
}
}
}
}
});