diff options
-rw-r--r-- | www/js/views/search.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/www/js/views/search.js b/www/js/views/search.js index 228bf21..0cf1de2 100644 --- a/www/js/views/search.js +++ b/www/js/views/search.js @@ -10,7 +10,8 @@ 'click #locate': 'goLocate', 'pagehide': 'destroy', 'pagebeforeshow': 'beforeDisplay', - 'pageshow': 'afterDisplay' + 'pageshow': 'afterDisplay', + 'submit #postcodeForm': 'search' }, afterDisplay: function() { @@ -19,7 +20,9 @@ } }, - search: function() { + search: function(e) { + // this is to stop form submission + e.preventDefault(); var pc = this.$('#pc').val(); this.listenTo(FMS.locator, 'search_located', this.searchSuccess ); this.listenTo(FMS.locator, 'search_failed', this.searchFail); @@ -44,6 +47,8 @@ }, searchFail: function( details ) { + // this makes sure any onscreen keyboard is dismissed + $('#submit').focus(); this.stopListening(FMS.locator); if ( details.msg ) { this.displayError( details.msg ); |