diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-09-21 09:10:58 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-09-25 13:28:14 +0100 |
commit | 85a6b7df9bd0b1711637b39d5a63ed6434686b33 (patch) | |
tree | 3a96fd0c05bfc47a642b23317a01275b6a8ab173 /web | |
parent | a38ecfbe4c5e5741f902eab498a83857500ea8cc (diff) |
If text auth on, ask which method they wish to use
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 5485ff7c7..09f4f49a3 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -1094,16 +1094,16 @@ $.extend(fixmystreet.set_up, { }); }, - reporting_hide_phone_email: function() { - $('#form_username_register').on('keyup change', function() { - var username = $(this).val(); - if (/^[^a-z]+$/i.test(username)) { - $('#js-hide-if-username-phone').hide(); - $('#js-hide-if-username-email').show(); - } else { - $('#js-hide-if-username-phone').show(); - $('#js-hide-if-username-email').hide(); - } + reporting_required_phone_email: function() { + var fem = $('#form_email'); + var fph = $('#form_phone'); + $('#update_method_email').on('change', function() { + fem.prop('required', true); + fph.prop('required', false); + }); + $('#update_method_phone').on('change', function() { + fem.prop('required', false); + fph.prop('required', true); }); }, |