mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 20:20:58 +00:00
BuildAttachmentDelete form
This commit is contained in:
@ -438,13 +438,25 @@ function constructFormBody(fields, options) {
|
||||
// The "submit" button will be disabled unless "confirm" is checked
|
||||
function insertConfirmButton(options) {
|
||||
|
||||
var message = options.confirmMessage || '{% trans "Confirm" %}';
|
||||
|
||||
var confirm = `
|
||||
<span style='float: left;'>
|
||||
Confirm
|
||||
<input name='confirm' type='checkbox'>
|
||||
${message}
|
||||
<input id='modal-confirm' name='confirm' type='checkbox'>
|
||||
</span>`;
|
||||
|
||||
$(options.modal).find('#modal-footer-buttons').append(confirm);
|
||||
|
||||
// Disable the 'submit' button
|
||||
$(options.modal).find('#modal-form-submit').prop('disabled', true);
|
||||
|
||||
// Trigger event
|
||||
$(options.modal).find('#modal-confirm').change(function() {
|
||||
var enabled = this.checked;
|
||||
|
||||
$(options.modal).find('#modal-form-submit').prop('disabled', !enabled);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user