From 6ae1692c270c1d0ca376522d230820a5a2a8b6a0 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sun, 9 Nov 2008 23:37:42 +0000 Subject: [PATCH] BUGFIX: Fixed usability issue with CalendarDateField required field validation. Slightly over-coupled; resolve that in the jQuery validation rewrite. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@65490 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/Validator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forms/Validator.php b/forms/Validator.php index 318bde15c..98afb7b75 100755 --- a/forms/Validator.php +++ b/forms/Validator.php @@ -108,7 +108,12 @@ Behaviour.register({ }, onblur : function() { if(this.old_onblur()) { - return $('$formID').validate(this); + // Don't perform instant validation for CalendarDateField fields; it creates usability wierdness. + if(this.parentNode.className.indexOf('calendardate') == -1 || this.value) { + return $('$formID').validate(this); + } else { + return true; + } } } },