Javascript 从JSON模式创建表单,如何添加关闭按钮?

Javascript 从JSON模式创建表单,如何添加关闭按钮?,javascript,jquery,json,jquery-ui,getjson,Javascript,Jquery,Json,Jquery Ui,Getjson,用这个我创造了一个新的形式 $('form').jsonForm({ schema: { name: {type: 'string', title: 'Name', required: true}, //age: {type: 'number', title: 'Age', required: true}, comment: {type: 'textarea', title: 'Comments', required: true},

用这个我创造了一个新的形式

$('form').jsonForm({
    schema: {
        name: {type: 'string', title: 'Name', required: true},
        //age: {type: 'number', title: 'Age', required: true},
        comment: {type: 'textarea', title: 'Comments', required: true},             
        choice: {type: 'string',title: 'Title', 'enum': ['choice-1','choice-2','choice-3']},

    },          
    onSubmit: function (errors, values) {
      if (errors) {
        $('#res').html('<p>I beg your pardon?</p>');
      }
      else {
        $('#res').html('<p>Hello ' + values.name + '.' +
          (values.comment ? '<br/>You are ' + values.comment + '.' : '') +
          '</p>');
      }
    }
}); 
$('form').jsonForm({
模式:{
名称:{type:'string',title:'name',必需:true},
//年龄:{type:'number',title:'age',必填项:true},
注释:{type:'textarea',title:'Comments',required:true},
选项:{type:'string',title:'title',enum':['choice-1','choice-2','choice-3']},
},          
onSubmit:函数(错误、值){
如果(错误){
$('res').html('p>对不起?

); } 否则{ $('#res').html('Hello'+values.name+'.'+ (values.comment?“
您是“+values.comment+”:”)+ “

”); } } });
在此默认情况下,存在提交按钮

但我想添加“关闭”按钮


或者,我如何删除或隐藏默认的“提交”按钮,以便添加其他提交和关闭按钮?

考虑覆盖jsonform&或者自己在隐藏默认提交按钮上添加关闭按钮。他们有非常棒的文档。我认为关于添加自定义按钮的文档并不简单@eegloo查看我下面关于添加自定义按钮的回答。@srvikram13:谢谢你的回答。“.formactions{display:none;}”这是在CSS文件中添加的。这也是working@Pedram是的,我有这个链接,谢谢。但有些部分并不直截了当。这就是为什么我感到困惑。CSS中添加了“.formactions{display:none;}”。
$('form').jsonForm({
    ...code
}); 
// Save reference to parent element to append custom buttons
var btn-container = $('form input[type=submit]').parent();

// Remove default 'submit' button
$('form input[type=submit]').remove();

// now add custom buttons in btn-container