WIP for the front add attendee email validation
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 8 Dec 2017 21:47:25 +0000 (16:47 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 8 Dec 2017 21:47:25 +0000 (16:47 -0500)
Need to check this also when editing the attendee.

js/frontRegApp.js
js/views/front/registrantForm.js

index 35d7c27..68b2d01 100644 (file)
@@ -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({
index 21a937d..c65f1b5 100644 (file)
@@ -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({