Changeset 3379239
- Timestamp:
- 10/16/2025 06:11:11 AM (2 months ago)
- Location:
- form-masks-for-elementor
- Files:
-
- 6 edited
- 1 copied
-
tags/2.5.7 (copied) (copied from form-masks-for-elementor/trunk)
-
tags/2.5.7/assets/js/custom-mask-script.js (modified) (9 diffs)
-
tags/2.5.7/form-masks-for-elementor.php (modified) (3 diffs)
-
tags/2.5.7/readme.txt (modified) (2 diffs)
-
trunk/assets/js/custom-mask-script.js (modified) (9 diffs)
-
trunk/form-masks-for-elementor.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
form-masks-for-elementor/tags/2.5.7/assets/js/custom-mask-script.js
r3359005 r3379239 369 369 $(document).on("blur", selector, function () { 370 370 var input = $(this); 371 372 if(input.hasClass("hide-fme-mask-input")){ 373 return; 374 } 375 371 376 var val = input.val(); 372 377 var errorElement = input … … 872 877 873 878 if(recaptchaEvent[widgetId]){ 874 875 recaptchaEvent[widgetId].forEach(fn => { 876 submtBtnTag.one("click", fn); // use .one instead of .on 877 }); 879 submtBtnTag.on("click", recaptchaEvent[widgetId]); 878 880 } 879 881 … … 1018 1020 1019 1021 1020 if(previousBtn .length && inputMaskFields.length&& maskErrorArr[widgetId].length){1022 if(previousBtn && previousBtn.length && inputMaskFields && inputMaskFields.length && maskErrorArr[widgetId] && maskErrorArr[widgetId].length){ 1021 1023 1022 1024 var $subBtnTag = $submitBtn.find("button"); … … 1030 1032 1031 1033 1032 if(!recaptchaEvent[widgetId]){ 1033 1034 recaptchaEvent[widgetId] = origninalclick && origninalclick.click ? origninalclick.click.map(h => h.handler) : []; 1035 } 1036 1037 1038 1034 if(origninalclick && origninalclick.click){ 1035 1036 origninalclick.click.forEach((ele) => { 1037 if(ele.handler.toString().trim().includes("onV3FormSubmit")){ 1038 1039 if(!recaptchaEvent[widgetId]){ 1040 1041 recaptchaEvent[widgetId] = ele.handler; 1042 1043 } 1044 1045 } 1046 }) 1047 1048 } 1039 1049 1040 1050 // getting form apply step events … … 1042 1052 const origninalSubmit = jQuery._data($form[0], "events"); 1043 1053 1044 origninalSubmit.submit.forEach((ele) => { 1045 if(ele.handler.toString().trim().includes("resetForm")){ 1046 1047 if(!submitBtnEvent[widgetId]){ 1048 1049 submitBtnEvent[widgetId] = ele.handler; 1050 1054 if(origninalSubmit && origninalSubmit.submit){ 1055 1056 origninalSubmit.submit.forEach((ele) => { 1057 if(ele.handler.toString().trim().includes("resetForm")){ 1058 1059 if(!submitBtnEvent[widgetId]){ 1060 1061 submitBtnEvent[widgetId] = ele.handler; 1062 1063 } 1064 1051 1065 } 1052 1053 } 1054 }) 1055 1056 1057 1058 // removing form apply step event 1059 $form.off("submit", submitBtnEvent[widgetId]); 1060 1061 // removing submit button click events 1062 $subBtnTag.off("click"); 1066 }) 1067 } 1068 1069 if(submitBtnEvent[widgetId]){ 1070 // removing form apply step event 1071 $form.off("submit", submitBtnEvent[widgetId]); 1072 } 1073 1074 1075 if(recaptchaEvent[widgetId]){ 1076 // removing submit button click events 1077 $subBtnTag.off("click", recaptchaEvent[widgetId]); 1078 } 1063 1079 1064 1080 … … 1074 1090 1075 1091 var $submitBtn = $(this); 1076 1077 var $subBtnTag = $submitBtn.find("button");1078 1079 1092 1080 1093 if ($submitBtn.find('button').hasClass('cfkef-prevent-submit') || $submitBtn.find('button').hasClass('confirmation-pending') … … 1083 1096 } 1084 1097 1085 var $submitBtn = $(this);1086 1098 var $form = $submitBtn.closest("form"); 1087 1099 1100 const closesWidget = $form.closest(".elementor-widget-form"); 1101 const widgetId = closesWidget.data('id'); 1102 const submtBtnTag = $form.find("button[type='submit']"); 1088 1103 1089 1104 // Prevent double-clicks … … 1100 1115 $form[0].classList.add("elementor-form-waiting"); 1101 1116 1102 // e.preventDefault(); // Prevent default form submission1103 1104 1117 // Wait for mask errors or blur logic to complete 1105 1118 setTimeout(() => { 1106 1107 1108 1119 let hasVisibleMaskError = false; 1109 1120 … … 1111 1122 const $errors = $form.find(".mask-error").filter(function () { 1112 1123 return $(this).text().trim() !== "" && $(this).css("display") == "flex"; 1113 }); 1114 1115 if ($errors.length > 0) { 1116 hasVisibleMaskError = true; 1117 const $firstError = $errors.first(); 1118 $("html, body").animate({ 1119 scrollTop: $firstError.offset().top - 200 1120 }, 300); 1121 } 1122 1123 // ✅ Check for empty required masked fields 1124 const $emptyRequiredMasked = $form.find("input[required]").filter(function () { 1124 }); 1125 1126 if ($errors.length > 0) { 1127 hasVisibleMaskError = true; 1128 const $firstError = $errors.first(); 1129 $("html, body").animate({ 1130 scrollTop: $firstError.offset().top - 200 1131 }, 300); 1132 } 1133 1134 // ✅ Check for empty required masked fields 1135 const $emptyRequiredMasked = $form.find("input[required]").filter(function () { 1136 if(!$(this).hasClass('hide-fme-mask-input')){ 1125 1137 const val = $(this).val().trim(); 1126 1138 const isVisible = $(this).css("display") == "flex"; 1127 1139 return (val === "" || /^[\s_\-\(\)\.:/]+$/.test(val)); 1128 }); 1129 1130 1131 if ($emptyRequiredMasked.length > 0) { 1132 hasVisibleMaskError = true; 1133 const $firstEmpty = $emptyRequiredMasked.first(); 1134 $("html, body").animate({ 1135 scrollTop: $firstEmpty.offset().top - 200 1136 }, 300); 1137 $firstEmpty.focus(); 1138 } 1139 1140 // ❌ Validation failed 1141 if (hasVisibleMaskError) { 1142 // $form[0].classList.remove("elementor-form-waiting"); 1140 } 1141 }); 1142 1143 if ($emptyRequiredMasked.length > 0) { 1144 hasVisibleMaskError = true; 1145 const $firstEmpty = $emptyRequiredMasked.first(); 1146 $("html, body").animate({ 1147 scrollTop: $firstEmpty.offset().top - 200 1148 }, 300); 1149 $firstEmpty.focus(); 1150 } 1151 1152 // ❌ Validation failed 1153 if (hasVisibleMaskError) { 1154 // $form[0].classList.remove("elementor-form-waiting"); 1155 $submitBtn.data("clicked", false); 1156 e.preventDefault(); 1157 return; 1158 } 1159 1160 // ❌ Validation failed 1161 if (hasVisibleMaskError) { 1162 // $form[0].classList.remove("elementor-form-waiting"); 1163 $submitBtn.data("clicked", false); 1164 e.preventDefault(); 1165 return; 1166 } 1167 1168 if (!hasVisibleMaskError) { 1169 // ✅ All good — submit the form 1170 1171 1172 if(recaptchaEvent[widgetId]){ 1173 submtBtnTag.on("click", recaptchaEvent[widgetId]); 1174 submtBtnTag.trigger("click"); 1175 } 1176 1177 if(submitBtnEvent[widgetId]){ 1178 $form.on("submit", submitBtnEvent[widgetId]); 1179 submtBtnTag.trigger("click"); 1180 1181 } 1182 1183 $form[0].classList.remove("elementor-form-waiting"); 1143 1184 $submitBtn.data("clicked", false); 1144 e.preventDefault(); 1145 return; 1146 } 1147 1148 if (!hasVisibleMaskError) { 1149 // ✅ All good — submit the form 1150 $form[0].classList.remove("elementor-form-waiting"); 1151 $submitBtn.data("clicked", false); 1152 $submitBtn.trigger("submit"); 1153 } 1185 if(!recaptchaEvent[widgetId]){ 1186 1187 let error_messages = $form.find('.elementor-form-fields-wrapper').find('.elementor-message'); 1188 1189 if(error_messages && error_messages.length == 0){ 1190 1191 $form[0].requestSubmit(); 1192 } 1193 1194 1195 } 1196 } 1154 1197 1155 1198 }, 500); -
form-masks-for-elementor/tags/2.5.7/form-masks-for-elementor.php
r3364326 r3379239 6 6 * Author: Cool Plugins 7 7 * Author URI: https://coolplugins.net/?utm_source=fim_plugin&utm_medium=inside&utm_campaign=author_page&utm_content=plugins_list 8 * Version: 2.5. 68 * Version: 2.5.7 9 9 * Requires at least: 5.5 10 10 * Requires PHP: 7.4 … … 13 13 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 14 14 * Requires Plugins: elementor 15 * Elementor tested up to: 3.32. 216 * Elementor Pro tested up to: 3.32. 115 * Elementor tested up to: 3.32.4 16 * Elementor Pro tested up to: 3.32.2 17 17 */ 18 18 … … 23 23 } 24 24 25 define( 'FME_VERSION', '2.5. 6' );25 define( 'FME_VERSION', '2.5.7' ); 26 26 define( 'FME_FILE', __FILE__ ); 27 27 define( 'FME_PLUGIN_BASE', plugin_basename( FME_FILE ) ); -
form-masks-for-elementor/tags/2.5.7/readme.txt
r3364344 r3379239 6 6 Tested up to: 6.8.2 7 7 Requires PHP: 7.2 8 Stable tag: 2.5. 68 Stable tag: 2.5.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 Elementor tested up to: 3.32. 212 Elementor Pro tested up to: 3.32. 111 Elementor tested up to: 3.32.4 12 Elementor Pro tested up to: 3.32.2 13 13 14 14 Add input masks to Elementor Pro or Hello Plus form fields - phone, date, time, credit card, CPF, CNPJ, CEP & more for accurate entries. … … 192 192 == Changelog == 193 193 194 = 2.5.7 - Oct 16, 2025 = 195 - Fixed: - form submission issue with required hidden mask field. 196 194 197 = 2.5.6 - Sep 19, 2025 = 195 198 - Added: - Added other plugin recommendations for Pro Elements users. -
form-masks-for-elementor/trunk/assets/js/custom-mask-script.js
r3359005 r3379239 369 369 $(document).on("blur", selector, function () { 370 370 var input = $(this); 371 372 if(input.hasClass("hide-fme-mask-input")){ 373 return; 374 } 375 371 376 var val = input.val(); 372 377 var errorElement = input … … 872 877 873 878 if(recaptchaEvent[widgetId]){ 874 875 recaptchaEvent[widgetId].forEach(fn => { 876 submtBtnTag.one("click", fn); // use .one instead of .on 877 }); 879 submtBtnTag.on("click", recaptchaEvent[widgetId]); 878 880 } 879 881 … … 1018 1020 1019 1021 1020 if(previousBtn .length && inputMaskFields.length&& maskErrorArr[widgetId].length){1022 if(previousBtn && previousBtn.length && inputMaskFields && inputMaskFields.length && maskErrorArr[widgetId] && maskErrorArr[widgetId].length){ 1021 1023 1022 1024 var $subBtnTag = $submitBtn.find("button"); … … 1030 1032 1031 1033 1032 if(!recaptchaEvent[widgetId]){ 1033 1034 recaptchaEvent[widgetId] = origninalclick && origninalclick.click ? origninalclick.click.map(h => h.handler) : []; 1035 } 1036 1037 1038 1034 if(origninalclick && origninalclick.click){ 1035 1036 origninalclick.click.forEach((ele) => { 1037 if(ele.handler.toString().trim().includes("onV3FormSubmit")){ 1038 1039 if(!recaptchaEvent[widgetId]){ 1040 1041 recaptchaEvent[widgetId] = ele.handler; 1042 1043 } 1044 1045 } 1046 }) 1047 1048 } 1039 1049 1040 1050 // getting form apply step events … … 1042 1052 const origninalSubmit = jQuery._data($form[0], "events"); 1043 1053 1044 origninalSubmit.submit.forEach((ele) => { 1045 if(ele.handler.toString().trim().includes("resetForm")){ 1046 1047 if(!submitBtnEvent[widgetId]){ 1048 1049 submitBtnEvent[widgetId] = ele.handler; 1050 1054 if(origninalSubmit && origninalSubmit.submit){ 1055 1056 origninalSubmit.submit.forEach((ele) => { 1057 if(ele.handler.toString().trim().includes("resetForm")){ 1058 1059 if(!submitBtnEvent[widgetId]){ 1060 1061 submitBtnEvent[widgetId] = ele.handler; 1062 1063 } 1064 1051 1065 } 1052 1053 } 1054 }) 1055 1056 1057 1058 // removing form apply step event 1059 $form.off("submit", submitBtnEvent[widgetId]); 1060 1061 // removing submit button click events 1062 $subBtnTag.off("click"); 1066 }) 1067 } 1068 1069 if(submitBtnEvent[widgetId]){ 1070 // removing form apply step event 1071 $form.off("submit", submitBtnEvent[widgetId]); 1072 } 1073 1074 1075 if(recaptchaEvent[widgetId]){ 1076 // removing submit button click events 1077 $subBtnTag.off("click", recaptchaEvent[widgetId]); 1078 } 1063 1079 1064 1080 … … 1074 1090 1075 1091 var $submitBtn = $(this); 1076 1077 var $subBtnTag = $submitBtn.find("button");1078 1079 1092 1080 1093 if ($submitBtn.find('button').hasClass('cfkef-prevent-submit') || $submitBtn.find('button').hasClass('confirmation-pending') … … 1083 1096 } 1084 1097 1085 var $submitBtn = $(this);1086 1098 var $form = $submitBtn.closest("form"); 1087 1099 1100 const closesWidget = $form.closest(".elementor-widget-form"); 1101 const widgetId = closesWidget.data('id'); 1102 const submtBtnTag = $form.find("button[type='submit']"); 1088 1103 1089 1104 // Prevent double-clicks … … 1100 1115 $form[0].classList.add("elementor-form-waiting"); 1101 1116 1102 // e.preventDefault(); // Prevent default form submission1103 1104 1117 // Wait for mask errors or blur logic to complete 1105 1118 setTimeout(() => { 1106 1107 1108 1119 let hasVisibleMaskError = false; 1109 1120 … … 1111 1122 const $errors = $form.find(".mask-error").filter(function () { 1112 1123 return $(this).text().trim() !== "" && $(this).css("display") == "flex"; 1113 }); 1114 1115 if ($errors.length > 0) { 1116 hasVisibleMaskError = true; 1117 const $firstError = $errors.first(); 1118 $("html, body").animate({ 1119 scrollTop: $firstError.offset().top - 200 1120 }, 300); 1121 } 1122 1123 // ✅ Check for empty required masked fields 1124 const $emptyRequiredMasked = $form.find("input[required]").filter(function () { 1124 }); 1125 1126 if ($errors.length > 0) { 1127 hasVisibleMaskError = true; 1128 const $firstError = $errors.first(); 1129 $("html, body").animate({ 1130 scrollTop: $firstError.offset().top - 200 1131 }, 300); 1132 } 1133 1134 // ✅ Check for empty required masked fields 1135 const $emptyRequiredMasked = $form.find("input[required]").filter(function () { 1136 if(!$(this).hasClass('hide-fme-mask-input')){ 1125 1137 const val = $(this).val().trim(); 1126 1138 const isVisible = $(this).css("display") == "flex"; 1127 1139 return (val === "" || /^[\s_\-\(\)\.:/]+$/.test(val)); 1128 }); 1129 1130 1131 if ($emptyRequiredMasked.length > 0) { 1132 hasVisibleMaskError = true; 1133 const $firstEmpty = $emptyRequiredMasked.first(); 1134 $("html, body").animate({ 1135 scrollTop: $firstEmpty.offset().top - 200 1136 }, 300); 1137 $firstEmpty.focus(); 1138 } 1139 1140 // ❌ Validation failed 1141 if (hasVisibleMaskError) { 1142 // $form[0].classList.remove("elementor-form-waiting"); 1140 } 1141 }); 1142 1143 if ($emptyRequiredMasked.length > 0) { 1144 hasVisibleMaskError = true; 1145 const $firstEmpty = $emptyRequiredMasked.first(); 1146 $("html, body").animate({ 1147 scrollTop: $firstEmpty.offset().top - 200 1148 }, 300); 1149 $firstEmpty.focus(); 1150 } 1151 1152 // ❌ Validation failed 1153 if (hasVisibleMaskError) { 1154 // $form[0].classList.remove("elementor-form-waiting"); 1155 $submitBtn.data("clicked", false); 1156 e.preventDefault(); 1157 return; 1158 } 1159 1160 // ❌ Validation failed 1161 if (hasVisibleMaskError) { 1162 // $form[0].classList.remove("elementor-form-waiting"); 1163 $submitBtn.data("clicked", false); 1164 e.preventDefault(); 1165 return; 1166 } 1167 1168 if (!hasVisibleMaskError) { 1169 // ✅ All good — submit the form 1170 1171 1172 if(recaptchaEvent[widgetId]){ 1173 submtBtnTag.on("click", recaptchaEvent[widgetId]); 1174 submtBtnTag.trigger("click"); 1175 } 1176 1177 if(submitBtnEvent[widgetId]){ 1178 $form.on("submit", submitBtnEvent[widgetId]); 1179 submtBtnTag.trigger("click"); 1180 1181 } 1182 1183 $form[0].classList.remove("elementor-form-waiting"); 1143 1184 $submitBtn.data("clicked", false); 1144 e.preventDefault(); 1145 return; 1146 } 1147 1148 if (!hasVisibleMaskError) { 1149 // ✅ All good — submit the form 1150 $form[0].classList.remove("elementor-form-waiting"); 1151 $submitBtn.data("clicked", false); 1152 $submitBtn.trigger("submit"); 1153 } 1185 if(!recaptchaEvent[widgetId]){ 1186 1187 let error_messages = $form.find('.elementor-form-fields-wrapper').find('.elementor-message'); 1188 1189 if(error_messages && error_messages.length == 0){ 1190 1191 $form[0].requestSubmit(); 1192 } 1193 1194 1195 } 1196 } 1154 1197 1155 1198 }, 500); -
form-masks-for-elementor/trunk/form-masks-for-elementor.php
r3364326 r3379239 6 6 * Author: Cool Plugins 7 7 * Author URI: https://coolplugins.net/?utm_source=fim_plugin&utm_medium=inside&utm_campaign=author_page&utm_content=plugins_list 8 * Version: 2.5. 68 * Version: 2.5.7 9 9 * Requires at least: 5.5 10 10 * Requires PHP: 7.4 … … 13 13 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 14 14 * Requires Plugins: elementor 15 * Elementor tested up to: 3.32. 216 * Elementor Pro tested up to: 3.32. 115 * Elementor tested up to: 3.32.4 16 * Elementor Pro tested up to: 3.32.2 17 17 */ 18 18 … … 23 23 } 24 24 25 define( 'FME_VERSION', '2.5. 6' );25 define( 'FME_VERSION', '2.5.7' ); 26 26 define( 'FME_FILE', __FILE__ ); 27 27 define( 'FME_PLUGIN_BASE', plugin_basename( FME_FILE ) ); -
form-masks-for-elementor/trunk/readme.txt
r3364344 r3379239 6 6 Tested up to: 6.8.2 7 7 Requires PHP: 7.2 8 Stable tag: 2.5. 68 Stable tag: 2.5.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 Elementor tested up to: 3.32. 212 Elementor Pro tested up to: 3.32. 111 Elementor tested up to: 3.32.4 12 Elementor Pro tested up to: 3.32.2 13 13 14 14 Add input masks to Elementor Pro or Hello Plus form fields - phone, date, time, credit card, CPF, CNPJ, CEP & more for accurate entries. … … 192 192 == Changelog == 193 193 194 = 2.5.7 - Oct 16, 2025 = 195 - Fixed: - form submission issue with required hidden mask field. 196 194 197 = 2.5.6 - Sep 19, 2025 = 195 198 - Added: - Added other plugin recommendations for Pro Elements users.
Note: See TracChangeset
for help on using the changeset viewer.