},
addNew: function(){
var findByEmail = [];
- console.log( 'called addNew in regClass view' );
var fname = this.$('.reg_fname').val().trim();
var lname = this.$('.reg_lname').val().trim();
var email = this.$('.reg_email').val().trim();
var state = this.$('.reg_state').val().trim();
var zip = this.$('.reg_zip').val().trim();
var country = this.$('.reg_country').val().trim();
- var rTime = this.$('#reg-select-time').val().trim();
+ if ( this.$('#reg-select-time').length ) {
+ var rTime = this.$('#reg-select-time').val().trim();
+ } else {
+ var rTime = null;
+ }
if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return;
} else {
findByEmail = this.model.registrants.where({email: email});
}
- console.log(findByEmail);
var regRequest = cart.get( 'request' );
if ( findByEmail.length === 0 ) {
this.model.registrants.create({
},
addNew: function(){
var findByEmail = [];
- console.log( 'called addNew in regClass view' );
var fname = this.$('.reg_fname').val().trim();
var lname = this.$('.reg_lname').val().trim();
var email = this.$('.reg_email').val().trim();
var state = this.$('.reg_state').val().trim();
var zip = this.$('.reg_zip').val().trim();
var country = this.$('.reg_country').val().trim();
- var rTime = this.$('#reg-select-time').val().trim();
+ if ( this.$('#reg-select-time').length ) {
+ var rTime = this.$('#reg-select-time').val().trim();
+ } else {
+ var rTime = null;
+ }
if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return;
} else {
findByEmail = this.model.registrants.where({email: email});
}
- console.log(findByEmail);
var regRequest = cart.get( 'request' );
if ( findByEmail.length === 0 ) {
this.model.registrants.create({