aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-19 12:36:13 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-19 17:02:04 +0000
commitc4169478a3cd94902b9d4d5ca166dbd85bca09ce (patch)
treeb9dae4cd397bc76be1704666390bf648d14ef4d1 /web/js
parente1c030cfd06f2c2791d3811179040d674692a27e (diff)
Make who question more prominent.
Diffstat (limited to 'web/js')
-rw-r--r--web/js/contact.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/js/contact.js b/web/js/contact.js
new file mode 100644
index 000000000..9529ede16
--- /dev/null
+++ b/web/js/contact.js
@@ -0,0 +1,14 @@
+$('[name=dest]').change(function() {
+ var err = $('.form-error--' + this.value),
+ inputs = $(this).closest('form').find('input[type=text], input[type=submit]');
+ $('.form-error__box').addClass('hidden');
+ if (err.length) {
+ $('#dest-error').removeClass('hidden');
+ $('#dest-error .form-error').show(); // might have been hidden by normal validate
+ inputs.prop('disabled', true);
+ $('.form-error--' + this.value).removeClass('hidden');
+ } else {
+ $('#dest-error').addClass('hidden');
+ inputs.prop('disabled', false);
+ }
+});