diff --git a/public/src/installer/install.js b/public/src/installer/install.js index 1fa56e32d6..80d46bf337 100644 --- a/public/src/installer/install.js +++ b/public/src/installer/install.js @@ -22,9 +22,24 @@ $('document').ready(function() { activate($(this).attr('name'), $(this)); }); + $('form').submit(validateAll); + activate('database', $('[name="database"]')); } + function validateAll(ev) { + $('form .admin [name]').each(function() { + activate($(this).attr('name'), $(this)); + }); + + if ($('.error').length) { + ev.preventDefault(); + $('html, body').animate({'scrollTop': '0px'}, 400); + + return false; + } + } + function activate(type, el) { var field = el.val(), parent = el.parents('.input-row'), diff --git a/src/views/install/index.tpl b/src/views/install/index.tpl index 633fb870cb..5bf430e290 100644 --- a/src/views/install/index.tpl +++ b/src/views/install/index.tpl @@ -48,55 +48,60 @@ You are just a few steps away from launching your own NodeBB forum!