Browse Source

Add required fields for ones that are sometimes pre-selected

pull/160/head
ariannedee 5 years ago
parent
commit
b746a92db9
3 changed files with 19 additions and 2 deletions
  1. +16
    -0
      edivorce/apps/core/static/js/main.js
  2. +2
    -1
      edivorce/apps/core/templates/question/06_children_facts.html
  3. +1
    -1
      edivorce/apps/core/templates/question/06_children_what_for.html

+ 16
- 0
edivorce/apps/core/static/js/main.js View File

@ -727,6 +727,22 @@ $(function () {
}
});
// The question child_support_in_order is required, but if child support isn't in want_which_orders
// the question is disabled and it is automatically set to NO and saved to the DB
var setWantChildOrder = function () {
var noChildSupportOption = $('input[name="child_support_in_order"][value="NO"]');
var optionInPage = noChildSupportOption.length > 0;
if (optionInPage) {
var optionIsUnchecked = noChildSupportOption.prop('checked') === false;
var childSupportNotInOrders = noChildSupportOption.data('no_child_order') === true;
if (optionIsUnchecked && childSupportNotInOrders) {
noChildSupportOption.prop('checked', true);
ajaxCall('child_support_in_order', 'NO');
}
}
}
setWantChildOrder();
// For Prequalification step 3
// If there is invalid date on reconciliation period,
// prevent user from navigate away from the page when user clicks next or back button, or use side navigation


+ 2
- 1
edivorce/apps/core/templates/question/06_children_facts.html View File

@ -22,7 +22,7 @@
{% include "partials/fact_sheets/fact_sheet_c.html" %}
{% endif %}
<div class="question-well" id="who_is_payor">
<div class="question-well {% if child_support_payor_error %}error{% endif %}" id="who_is_payor">
{% money_input_field name="annual_gross_income" hidden="true" %}
{% money_input_field name="spouse_annual_gross_income" hidden="true" %}
<span id="__name_you" hidden>{{ name_you }}</span>
@ -38,6 +38,7 @@
payor<i class="fa fa-question-circle" aria-hidden="true"></i>
</span>
?
{% if child_support_payor_error %}{% include 'partials/required.html' %}{% endif %}
</h3>
{% if derived.show_fact_sheet_b %}
<p>


+ 1
- 1
edivorce/apps/core/templates/question/06_children_what_for.html View File

@ -89,7 +89,7 @@
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" %}
We are not asking for child support to be included in the order</label>
{% else %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" disabled="" checked="" %}
<label>{% input_field type="radio" class="radio-with-other radio_with_textbox" name="child_support_in_order" value="NO" data_target_id="child_support_in_order_detail" data_reveal_target="true" data_target_class="support-amount-match" data_reveal_class="false" data_no_child_order="true" disabled="" %}
We are not asking for child support to be included in the order</label>
<div class="information-message bg-danger">
<p>This option has been automatically selected for you because you indicated in Step 1 you didn't want an "Order pertaining to children"</p>


Loading…
Cancel
Save