From 5a3791a89e8989b460746e03c14cea8bdb8ab3b5 Mon Sep 17 00:00:00 2001 From: Charles Shin Date: Wed, 23 Oct 2019 12:36:41 -0700 Subject: [PATCH] DIV-963: Updated order pertaining children logic to update value of child support question. --- edivorce/apps/core/static/js/main.js | 13 +++++ .../core/templates/question/01_orders.html | 2 +- .../question/06_children_what_for.html | 48 +++++++++++++------ 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 6c6001a4..86eda19d 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -688,6 +688,19 @@ $(function () { } }); + // If Orders pertaining to children is not selected from want which order page, + // update the value of child_support_in_order on Step 6: What are you asking for + // to "NO" + $('#order_child_support').on('change', function() { + var orderChildSupport = $(this).prop('checked'); + + if (!orderChildSupport) { + var question = 'child_support_in_order'; + var value = 'NO'; + ajaxCall(question, value); + } + }); + $('#check_order_selected').on('click', function (e) { var showAlert = $(this).data('show_alert'); var childSupport = $('input[data-target_id=child_support_alert]').prop('checked'); diff --git a/edivorce/apps/core/templates/question/01_orders.html b/edivorce/apps/core/templates/question/01_orders.html index 2b2162ab..13e0539c 100644 --- a/edivorce/apps/core/templates/question/01_orders.html +++ b/edivorce/apps/core/templates/question/01_orders.html @@ -177,7 +177,7 @@ asked to provide details for each request.

diff --git a/edivorce/apps/core/templates/question/06_children_what_for.html b/edivorce/apps/core/templates/question/06_children_what_for.html index bd573f52..bb44bc56 100644 --- a/edivorce/apps/core/templates/question/06_children_what_for.html +++ b/edivorce/apps/core/templates/question/06_children_what_for.html @@ -28,7 +28,11 @@
- + + {% if 'Child support' in want_which_orders|load_json %} + + {% else %} + +
+

This option has been automatically selected for you because you indicated in Step 1 you didn't want an "Order pertaining to children"

+
+ {% endif %}

Please describe what arrangements have been made for the support of the child (ren)? {% input_field type="textarea" name="child_support_in_order_reason" class="other-textbox response-textarea form-control" tabindex="-1" maxlength="500" rows="3" %}