aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/views/submit.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2014-04-03 11:19:19 +0100
committerStruan Donald <struan@exo.org.uk>2014-04-03 11:19:19 +0100
commit99b5f408be0aee9b553c852080bf6a87cbe3b5f1 (patch)
tree9edd57528a712338c52a0e877262293ce8e6fb16 /src/js/views/submit.js
parent0bcbd779222f31c8115009a73ba6e1d70ade28c6 (diff)
Need to confirm title on password screen as well
Yet another place where we confirm the name and hence need to confirm the title if required
Diffstat (limited to 'src/js/views/submit.js')
-rw-r--r--src/js/views/submit.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/views/submit.js b/src/js/views/submit.js
index 647edec..6a7c946 100644
--- a/src/js/views/submit.js
+++ b/src/js/views/submit.js
@@ -336,6 +336,13 @@
this.validationError('form_password', FMS.validationStrings.password );
}
+ if ( $('#form_name').val() && this.model.get('titles_list') && this.model.get('titles_list').length > 0 ) {
+ if ( $('#form_title').val() === '' ) {
+ this.validationError('form_title', FMS.strings.required);
+ isValid = 0;
+ }
+ }
+
return isValid;
},
@@ -350,6 +357,9 @@
this.model.set('may_show_name', $('#form_may_show_name').is(':checked'));
FMS.currentUser.set('name', $('#form_name').val());
FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked'));
+ if ( this.model.get('titles_list') && this.model.get('titles_list').length > 0 ) {
+ FMS.currentUser.set('title', $('#form_title').val());
+ }
FMS.currentUser.save();
} else {
// if this is set then we are registering a password