From e53bf603e5dc24b18ed092dbf456cd652eb358eb Mon Sep 17 00:00:00 2001 From: Teon Ooi Date: Mon, 16 Dec 2024 15:55:53 +0800 Subject: [PATCH 1/2] [twgit] Init feature 'feature-PRESIDECMS-2906_client-side-validation-defensive-when-validator-didnt-have-client-side-defined'. From f73cbf6084621ac860c971739d55c84b9adbe92d Mon Sep 17 00:00:00 2001 From: Teon Ooi Date: Mon, 16 Dec 2024 15:56:32 +0800 Subject: [PATCH 2/2] PRESIDECMS-2906 Update to load form dependencies. --- system/views/formcontrols/layouts/form.cfm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/system/views/formcontrols/layouts/form.cfm b/system/views/formcontrols/layouts/form.cfm index 6251b32ada..ece5cf9e98 100644 --- a/system/views/formcontrols/layouts/form.cfm +++ b/system/views/formcontrols/layouts/form.cfm @@ -53,13 +53,18 @@ + - ( function( $ ){ - var validator = $('###formId#').validate() - , options = #validationJs#; + ( function( $ ) { + if ( typeof executeWithFormBuilderDependencies !== 'undefined' ) { + executeWithFormBuilderDependencies( function( $ ) { + var validator = $( '###formId#' ).validate() + , options = #validationJs#; - validator.settings.rules = $.extend( validator.settings.rules , options.rules ); - validator.settings.messages = $.extend( validator.settings.messages, options.messages ); + validator.settings.rules = $.extend( validator.settings.rules , options.rules ); + validator.settings.messages = $.extend( validator.settings.messages, options.messages ); + } ); + }; } )( #validationJsJqueryRef# );