aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-07-05 15:37:28 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-07-19 12:06:53 +0100
commitde0c9769541ef889ccc3f9f3289e01538d3f071e (patch)
treee2e7a28378df065a46a90c6b90b7d475e85502ae
parent460d560865d018867686a7385a4a6de6faf6e983 (diff)
Make sure invalid focuses on split form.
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index d39b6a0e9..60fbb723b 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -932,7 +932,9 @@ $.extend(fixmystreet.set_up, {
});
$('.js-new-report-user-show').click(function(e) {
e.preventDefault();
- if (!$(this).closest('form').validate().form()) {
+ var v = $(this).closest('form').validate();
+ if (!v.form()) {
+ v.focusInvalid();
return;
}
$('.js-new-report-user-hidden')[0].scrollIntoView({behavior: "smooth"});