mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-12 02:48:48 -04:00
Fix greyed out submit button after validation (#3122)
This commit is contained in:
@@ -15,17 +15,14 @@
|
||||
const form = $('form', dlog_ref.$modalBody).first();
|
||||
const validator = form.data('validator');
|
||||
const submitted = validator && validator.formSubmitted;
|
||||
const is_valid = !$.isEmptyObject(validator.invalid)
|
||||
|
||||
btn_id = button_id;
|
||||
dialog_ref = dlog_ref;
|
||||
|
||||
if (button_id == 'submit' && is_valid && button_id != "btnNew"){
|
||||
$('#submit').prop('disabled', true).css('opacity', 0.5);
|
||||
}
|
||||
|
||||
if (button_id == 'submit' && (!submitted && btn_id != "btnNew")) {
|
||||
form.submit();
|
||||
|
||||
validator.valid() && $('#submit').prop('disabled', true).css('opacity', 0.5);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user