diff options
author | Struan Donald <struan@exo.org.uk> | 2012-10-26 10:50:01 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-10-26 10:50:01 +0100 |
commit | 1974a2e101b7df603a7e7ba9416a9bce1062d49f (patch) | |
tree | cf4f8a8fbaf51e101712e9f420c912f426ea5ec0 /www/js/mobile.js | |
parent | b603eb98165fbba84227bacad5873a82e7e53479 (diff) |
make sure we do not add multiple form name error messages
Diffstat (limited to 'www/js/mobile.js')
-rw-r--r-- | www/js/mobile.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/www/js/mobile.js b/www/js/mobile.js index 8ad9908..c173133 100644 --- a/www/js/mobile.js +++ b/www/js/mobile.js @@ -225,7 +225,11 @@ function check_name( name, msg ) { $('#form_name').val( name ); if ( msg ) { $('#form_name').focus(); - $('#form_name').before('<div class="form-error">' + msg + '</div>' ); + if ( $('#form_name_error').length ) { + $('#form_name_error').text(msg); + } else { + $('#form_name').before('<div class="form-error" id="form_name_error">' + msg + '</div>' ); + } } } |