我有一个表单,下一个有一个按钮。单击此下一步按钮时,应导航到其他表单。
我已经创建了两个表单,但无法将它们链接起来。
$("#field1").alpaca({
"schema": {
"title": "Name Info",
"type": "object",
"properties": {
"firstName": {
"title": "First Name",
"type": "string"
},
"lastName": {
"title": "Last Name",
"type": "string"
}
}
},
"options": {
"form": {
"buttons": {
"next": {
"click": function() {}
}
}
}
}
});发布于 2016-03-04 18:22:50
你有没有试过使用Wizards,我想这可能会对你有帮助。告诉我如果这不是你要找的,我会试着帮你。
发布于 2017-09-01 00:36:18
@smileisbest和@Shabbir-Dhangot,我在同一个页面中实现了两个表单。使用JSON库序列化数据并发送到下一个表单:
"click" : function() {
var editJsonData = JSON.stringify(this.getValue(), null, " ");
doNext(editJsonData);
}然后将调用作为函数添加到下一个表单:
// If JSON data is not null, the next form will display.
var doNext = function(jsonData) {
$("#NextForm").empty();
if (null != jsonData) {
// Validate user or data...
// This starts the Editor form
$("#NextForm").alpaca({
"data" : jsonData,
"schema" : {
"type" : "object",
"properties" : { ...使用show/hide适当地隐藏先前的表单:
$("#field1").hide();
$("#NextForm").show();https://stackoverflow.com/questions/35766654
复制相似问题