With this https://github.com/joshfire/jsonform I have created Form.
$('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>');
}
}
});
In this By Default Submit button is present.
But I want to add "Close" button.
Or How can I remove or hide that Default "Submit" button, so that I will add other submit and close button?
$('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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.