Browse Source

DIV-818: Limiting to positive float instead of positive integer

pull/160/head
Benard Ebinu 7 years ago
parent
commit
4458abe836
2 changed files with 10 additions and 1 deletions
  1. +9
    -0
      edivorce/apps/core/static/js/main.js
  2. +1
    -1
      edivorce/apps/core/templates/question/06_children_what_for.html

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

@ -580,6 +580,15 @@ $(function () {
e.preventDefault();
}
});
$('.positive-float').on('keypress', function(e) {
// keyCode [95-105] - number page
// keyCode [48-57] - 0-9
// keyCode [8] - backspace
// keyCode [37-40] - directional arrows
if (!((e.which > 95 && e.which < 106) || (e.which > 45 && e.which < 58) || e.which === 8 || (e.keyCode > 36 && e.keyCode < 41))) {
e.preventDefault();
}
});
$('.fact-sheet-input').on('focus', function() {
$(this).closest('td').addClass('table-cell-active');


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

@ -36,7 +36,7 @@
{% input_field type="radio" class="radio-centered radio-with-other radio_with_textbox" name="child_support_in_order" value="YES" %}
{% endif %}
<div class="dollar-prefix">
{% money_input_field name="order_monthly_child_support_amount" class="money positive-integer form-block response-textbox children-input-block" data_mirror="true" data_mirror_target="#child_support_amount_label" %}
{% money_input_field name="order_monthly_child_support_amount" class="money positive-float form-block response-textbox children-input-block" data_mirror="true" data_mirror_target="#child_support_amount_label" %}
</div>
</label>
</div>


Loading…
Cancel
Save