From: Steve Sutton Date: Fri, 8 Dec 2017 21:47:25 +0000 (-0500) Subject: WIP for the front add attendee email validation X-Git-Tag: v1.0.0^2~231 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=1aca322e49c06c30b32e73076f9602551c16de57;p=WP-Plugins%2Fglm-member-db-registrations.git WIP for the front add attendee email validation Need to check this also when editing the attendee. --- diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 35d7c27..68b2d01 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -1048,6 +1048,8 @@ app.Views.Front.RegistrantForm = Backbone.View.extend({ var isValidEmail = app.isValidEmail( email ); if ( !isValidEmail ) { alert( 'Email must be valid' ); + this.$('.add_reg_email').val(''); + return; } else { // Check to see if this is a valid email. jQuery.ajax({ diff --git a/js/views/front/registrantForm.js b/js/views/front/registrantForm.js index 21a937d..c65f1b5 100644 --- a/js/views/front/registrantForm.js +++ b/js/views/front/registrantForm.js @@ -36,6 +36,8 @@ app.Views.Front.RegistrantForm = Backbone.View.extend({ var isValidEmail = app.isValidEmail( email ); if ( !isValidEmail ) { alert( 'Email must be valid' ); + this.$('.add_reg_email').val(''); + return; } else { // Check to see if this is a valid email. jQuery.ajax({