From c924ab7c4f9f0bd13de9b3b99487a4c498db879a Mon Sep 17 00:00:00 2001 From: ariannedee Date: Tue, 22 Sep 2020 16:42:07 -0700 Subject: [PATCH] DIV-1142: Don't let the user continue if they're missing email fields --- edivorce/apps/core/static/js/signing-filing.js | 17 +++++++++++++++++ .../templates/dashboard/sign_file_options.html | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/edivorce/apps/core/static/js/signing-filing.js b/edivorce/apps/core/static/js/signing-filing.js index 8dc885d2..ee8a9bdd 100644 --- a/edivorce/apps/core/static/js/signing-filing.js +++ b/edivorce/apps/core/static/js/signing-filing.js @@ -59,6 +59,7 @@ $(window).load(function () { } else { $("#email-spouse").hide(); } + $('#unfilled-email-alert').hide(); } function toggleFileInPerson() { @@ -94,4 +95,20 @@ $(window).load(function () { toggleSigningLocation(); toggleSignVirtually(); toggleFileInPerson(); + + $('#check-email-filled').on('click', function (e) { + var yourEmailInput = $('#email-you-input'); + var yourEmailError = yourEmailInput.is(":visible") && !yourEmailInput.val(); + var spouseEmailInput = $('#email-spouse-input'); + var spouseEmailError = spouseEmailInput.is(":visible") && !spouseEmailInput.val(); + if (yourEmailError || spouseEmailError) { + $('#unfilled-email-alert').show(); + $('#error-email-you').toggle(yourEmailError) + $('#error-email-spouse').toggle(spouseEmailError) + e.preventDefault(); + } else { + $('#unfilled-email-alert').hide(); + } + }); + }); \ No newline at end of file diff --git a/edivorce/apps/core/templates/dashboard/sign_file_options.html b/edivorce/apps/core/templates/dashboard/sign_file_options.html index ca37e3f9..c5d9fefb 100644 --- a/edivorce/apps/core/templates/dashboard/sign_file_options.html +++ b/edivorce/apps/core/templates/dashboard/sign_file_options.html @@ -136,10 +136,10 @@

An e-mail address is required to setup a {% include "partials/tooltips/virtual_session.html" %}. What is the best e-mail address to contact you at in order to setup the virtual session?

- {% input_field type="text" name="email_you" id="email_you" class="input-inline form-control" %} + {% input_field type="text" name="email_you" id="email-you-input" class="input-inline form-control" %}
- {% input_field type="text" name="email_spouse" id="email_spouse" class="input-inline form-control" %} + {% input_field type="text" name="email_spouse" id="email-spouse-input" class="input-inline form-control" %}
+ {% endblock %} {% block backToDashboard %} @@ -155,6 +164,7 @@ {% block formBack %}{% url 'overview' %}{% endblock %} {% block formNext %}{% url 'dashboard_nav' 'print_form' %}{% endblock %} +{% block nextButtonAttribute %}id="check-email-filled" data-proceed="false" data-show_alert="false"{% endblock %} {% block sidebarText %}

What is the process to file for divorce?