diff options
author | Struan Donald <struan@exo.org.uk> | 2013-06-19 13:50:36 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-06-19 13:50:36 +0100 |
commit | 7b3875984223b811a69fd914a17b87bc31086ba2 (patch) | |
tree | 5b3f46b04ba760e86ad184934311fb567a4233ae /www/js/views/submit.js | |
parent | ac5ac87248040e10f035154f6c17d91340b21c00 (diff) |
if a list of user titles is provided by the server ask for and require one
Diffstat (limited to 'www/js/views/submit.js')
-rw-r--r-- | www/js/views/submit.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/www/js/views/submit.js b/www/js/views/submit.js index c905e7e..3f4a035 100644 --- a/www/js/views/submit.js +++ b/www/js/views/submit.js @@ -199,6 +199,13 @@ } } + if ( this.model.get('title_list') && this.model.get('title_list').length > 0 ) { + if ( $('#form_title').val() === '' ) { + this.validationError('form_title', FMS.strings.required); + isValid = 0; + } + } + return isValid; }, @@ -207,6 +214,9 @@ this.model.set('submit_clicked', 'submit_register'); FMS.currentUser.set('name', $('#form_name').val()); FMS.currentUser.set('phone', $('#form_phone').val()); + if ( this.model.get('title_list') && this.model.get('title_list').length > 0 ) { + FMS.currentUser.set('title', $('#form_title').val()); + } this.navigate( 'submit-set-password' ); } }, @@ -215,6 +225,9 @@ this.model.set('name', $('#form_name').val()); this.model.set('phone', $('#form_phone').val()); this.model.set('may_show_name', $('#form_may_show_name').val()); + if ( this.model.get('title_list') && this.model.get('title_list').length > 0 ) { + FMS.currentUser.set('title', $('#form_title').val()); + } } }) }); |