diff --git a/js/webform_civicrm_forms.js b/js/webform_civicrm_forms.js index 7a13537a9..55cac32fb 100644 --- a/js/webform_civicrm_forms.js +++ b/js/webform_civicrm_forms.js @@ -452,10 +452,12 @@ var wfCivi = (function ($, D) { // Function to update fee field with AJAX call. function updateFeeField(membershipId, feeFieldInput) { - if (!membershipId || feeFieldInput.length === 0) { - return; + if (!membershipId) { + throw new Error("Membership Id not found."); + } + if ($(feeFieldInput).length === 0) { + throw new Error("Membership-fee-amount-from-membership not found."); } - $.ajax({ url: '/webform-civicrm/js/getMembershipFees/' + membershipId, dataType: 'json',