From 1aca322e49c06c30b32e73076f9602551c16de57 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 8 Dec 2017 16:47:25 -0500 Subject: [PATCH] WIP for the front add attendee email validation Need to check this also when editing the attendee. --- js/frontRegApp.js | 2 ++ js/views/front/registrantForm.js | 2 ++ 2 files changed, 4 insertions(+) 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({ -- 2.17.1