aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/fixmystreet.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-03-15 13:50:34 +0000
committerStruan Donald <struan@exo.org.uk>2012-03-15 13:50:34 +0000
commit4174f60e00c1615b7512f55f53e180426856a749 (patch)
tree9b46e9514ff72b0a400e0a55c7c1cc89678c00c4 /www/js/fixmystreet.js
parentb6a6c94631b0c714ee5a9e10e72f9b125b53587d (diff)
make validation work properly
Diffstat (limited to 'www/js/fixmystreet.js')
-rw-r--r--www/js/fixmystreet.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/www/js/fixmystreet.js b/www/js/fixmystreet.js
index de04ae2..30b35a5 100644
--- a/www/js/fixmystreet.js
+++ b/www/js/fixmystreet.js
@@ -186,8 +186,6 @@ $(function(){
if (form.submit_problem) {
$('input[type=submit]', form).prop("disabled", true);
}
-
- // form.submit();
},
// make sure we can see the error message when we focus on invalid elements
showErrors: function( errorMap, errorList ) {
@@ -197,7 +195,12 @@ $(function(){
this.defaultShowErrors();
submitted = false;
},
- invalidHandler: function(form, validator) { submitted = true; }
+ invalidHandler: function(form, validator) {
+ form.stopImmediatePropagation();
+ form.stopPropagation();
+ form.preventDefault();
+ submitted = true;
+ }
});
$('input[type=submit]').click( function(e) { form_submitted = 1; } );