Creating a function to replace the alert calls.
Was getting strange text placement issue with the dialogs.
Have css to position the ui-content to absolute.
#ui-id-1.ui-dialog-title {
line-height: 1;
}
+/* For jquery dialog */
+.ui-dialog .ui-dialog-content {
+ position: absolute !important;
+}
var country = ( this.$('.reg_country').val() ) ? this.$('.reg_country').val().trim(): '';
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail && email ) {
- alert( 'Email must be valid' );
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
this.$('.reg_email').val('');
return;
}
var rTime = null;
}
if ( app.timeSpecific && !rTime ) {
- alert( 'You must select a time!' );
+ glmRegNotice( 'Alert', 'You must select a time!' );
+ // alert( 'You must select a time!' );
return;
}
if ( fname === '' || lname === '' ) {
- alert( 'First and Last name required!' );
+ glmRegNotice( 'Required Fields', 'Please fill out First and Last Name!' );
+ // $('#attendeeFormReq').dialog('open');
+ // alert( 'First and Last name required!' );
return;
}
// Validate the model
// add new account
addNewAccount: function(){
if ( app.checkForMaxAttendees() === true ) {
- alert( 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
+ glmRegNotice( 'Max Reached', 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
+ // alert( 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
return;
}
// check for the lock
var zip = this.$('.add_reg_zip').val().trim();
var country = ( this.$('.add_reg_country').val() ) ? this.$('.add_reg_country').val().trim(): '';
var sTime = this.model.get( 'rate_id' );
+ var isValidEmail = app.isValidEmail( email );
+ if ( !isValidEmail && email ) {
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
+ this.$('.add_reg_email').val('');
+ return;
+ }
if ( this.$('#add_reg-select-time').length ) {
var times = this.model.get( 'times' );
} else {
return;
}
if ( fname === '' || lname === '' ) {
- alert( 'First and Last name required!' );
+ // $('#attendeeFormReq').dialog('open');
+ glmRegNotice( 'Required Fields', 'Please fill out First and Last Name!' );
+ // alert( 'First and Last name required!' );
// Hide the loading graphic
this.$('#loading-' + this.model.get('id') ).hide();
return;
}
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail ) {
- alert( 'Email must be valid' );
+ // $('#attendeeEmailNotValid').dialog('open');
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
+ // alert( 'Email must be valid' );
this.$('.add_reg_email').val('');
return;
}
}
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail ) {
- alert( 'Email must be valid' );
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
this.$('.lookup_email').val('');
return;
} else {
this.$('.account-lookup').hide();
} else {
// Notify them nothing found
- alert( 'Could not find account' );
+ glmRegNotice( 'Account Search', 'Could not find account' );
+ // alert( 'Could not find account' );
this.$('.add_reg_email').val(email);
}
})
var country = ( this.$('.reg_country').val() ) ? this.$('.reg_country').val().trim(): '';
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail && email ) {
- alert( 'Email must be valid' );
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
this.$('.reg_email').val('');
return;
}
var rTime = null;
}
if ( app.timeSpecific && !rTime ) {
- alert( 'You must select a time!' );
+ glmRegNotice( 'Alert', 'You must select a time!' );
+ // alert( 'You must select a time!' );
return;
}
if ( fname === '' || lname === '' ) {
- alert( 'First and Last name required!' );
+ glmRegNotice( 'Required Fields', 'Please fill out First and Last Name!' );
+ // $('#attendeeFormReq').dialog('open');
+ // alert( 'First and Last name required!' );
return;
}
// Validate the model
// add new account
addNewAccount: function(){
if ( app.checkForMaxAttendees() === true ) {
- alert( 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
+ glmRegNotice( 'Max Reached', 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
+ // alert( 'You\'re only allowed to have ' + app.attendeeMaxPerReg + ' ' + app.attendeePlurCapTerm + ' per Registration!' );
return;
}
// check for the lock
var zip = this.$('.add_reg_zip').val().trim();
var country = ( this.$('.add_reg_country').val() ) ? this.$('.add_reg_country').val().trim(): '';
var sTime = this.model.get( 'rate_id' );
+ var isValidEmail = app.isValidEmail( email );
+ if ( !isValidEmail && email ) {
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
+ this.$('.add_reg_email').val('');
+ return;
+ }
if ( this.$('#add_reg-select-time').length ) {
var times = this.model.get( 'times' );
} else {
return;
}
if ( fname === '' || lname === '' ) {
- alert( 'First and Last name required!' );
+ // $('#attendeeFormReq').dialog('open');
+ glmRegNotice( 'Required Fields', 'Please fill out First and Last Name!' );
+ // alert( 'First and Last name required!' );
// Hide the loading graphic
this.$('#loading-' + this.model.get('id') ).hide();
return;
}
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail ) {
- alert( 'Email must be valid' );
+ // $('#attendeeEmailNotValid').dialog('open');
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
+ // alert( 'Email must be valid' );
this.$('.add_reg_email').val('');
return;
}
}
var isValidEmail = app.isValidEmail( email );
if ( !isValidEmail ) {
- alert( 'Email must be valid' );
+ glmRegNotice( 'Email Validation', 'Email must be valid!' );
this.$('.lookup_email').val('');
return;
} else {
this.$('.account-lookup').hide();
} else {
// Notify them nothing found
- alert( 'Could not find account' );
+ glmRegNotice( 'Account Search', 'Could not find account' );
+ // alert( 'Could not find account' );
this.$('.add_reg_email').val(email);
}
})
</p>
</div>
{/if}
+ <div id="glmRegNoticeDialog" title="Glm Notice">
+ <p class="glm-reg-warning" style="width: 100%;margin: 0;padding: 15px;">
+ </p>
+ </div>
<div class="row">
<div id="regApp" class="columns small-12">
</div>
});
+ glmRegNotice = function( title, message ){
+ return $('<div class="glm-reg-dialog" title="' + title + '"><p class="glm-reg-warning">' + message + '</p></div>').dialog({
+ autoOpen: true,
+ modal: true,
+ width: 500,
+ height: 200,
+ buttons: [{
+ text: "Got it!",
+ click: function(){
+ // $(this).dialog('destroy');
+ $(this).dialog('close').dialog('destroy').remove();
+ }
+ }]
+ });
+ }
+
// Registration not submitted Dialog actions
{if $settings.reg_not_submitted_dialog}