Skip to content

Commit

Permalink
fix: webform validation script not working
Browse files Browse the repository at this point in the history
(cherry picked from commit cc20037)
  • Loading branch information
shariquerik authored and mergify[bot] committed Nov 1, 2022
1 parent 5ba85ec commit ab2b8df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frappe/public/js/frappe/web_form/web_form.js
Expand Up @@ -347,11 +347,13 @@ export default class WebForm extends frappe.ui.FieldGroup {

save() {
let is_new = this.is_new;
if (this.validate && !this.validate()) {
frappe.throw(
let valid = this.validate && this.validate();
if (!valid && valid !== undefined) {
frappe.msgprint(
__("Couldn't save, please check the data you have entered"),
__("Validation Error")
);
return false;
}

// validation hack: get_values will check for missing data
Expand Down

0 comments on commit ab2b8df

Please sign in to comment.