diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index e9b690e3..2e1c27f4 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -443,6 +443,22 @@ $(function () { populateChildrenFactSheets(); }); + // check who has sole custody + $('input[name="__claimant_children"]').each(function() { + var children = JSON.parse($(this).val()); + var youHaveSoleCustody = children.every(function(child){ + return child.child_live_with === 'Lives with you' + }); + var spouseHasSoleCustody = children.every(function(child){ + return child.child_live_with === 'Lives with spouse' + }); + + if (youHaveSoleCustody || spouseHasSoleCustody) { + $('#monthly_amount_question').show(); + } else { + $('#monthly_amount_question').hide(); + } + }); var payorCallback = function() { var claimant = $(this).val(); diff --git a/edivorce/apps/core/templates/question/06_children_income_expenses.html b/edivorce/apps/core/templates/question/06_children_income_expenses.html index 32300c4d..6413b482 100644 --- a/edivorce/apps/core/templates/question/06_children_income_expenses.html +++ b/edivorce/apps/core/templates/question/06_children_income_expenses.html @@ -248,7 +248,9 @@ -