From b17d4035c1382861e69e0a31152b3016e45b818d Mon Sep 17 00:00:00 2001 From: sbkolate Date: Mon, 22 Feb 2016 17:16:34 +0530 Subject: [PATCH] better validation example for developer throw "past date selected" will freeze the form and user can not correct value of from_date. but validated false will just throw the pop-up and user can correct value of from_date and save the form. Example changed from Event to Task because same is available in Custom Script Help for desk user --- .../custom-scripts/custom-script-examples/date-validation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md index 0d080af7c07..d68ab565f61 100644 --- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md +++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md @@ -1,10 +1,10 @@ # Date Validation - frappe.ui.form.on("Event", "validate", function(frm) { + frappe.ui.form.on("Task", "validate", function(frm) { if (frm.doc.from_date < get_today()) { msgprint(__("You can not select past date in From Date")); - throw "past date selected" + validated = false; } });