Closed nerdpruitt closed 9 years ago
From the Hemingway site, for future reference.
$('#btnContactSubmit').click(function () {
if ($('input[name="emma_member_email"]').val() == '' || $('input[name="emma_member_email"]').val() == 'JOIN OUR MAILING LIST') {
contactError.html('Please provide an email');
} else {
var userEmail = $('input[name="emma_member_email"]').val();
if (validateEmail(userEmail)) {
//iterate pathname so we can find where the emma script is...
var depthString = '', depth = 0, pathname = document.location.pathname;
for (var i = 0; i < pathname.length; i++)
{
if (pathname[i] === '/') {
depth++;
if (depth > 1) {
depthString += '../';
}
}
}
$.ajax({
type: 'POST',
url: depthString + '_themes/hemingway/emma.php',
data: {
'email': userEmail,
'name': 'none'
},
success: function (data) {
var obj = JSON.parse(data);
if (obj.status == 'a') {
contactError.html('SUCCESS! THANK YOU!');
} else {
contactError.html('We are sorry, there was an error with your submission.');
}
},
error: function (xhr) {
contactError.html('We are sorry, but there was an error.');
}
});
} else {
contactError.html('Is this a valid email?');
}
}
});
I just realized I did not create a group within EMMA for the sign-ups to go to. So not sure if this is working yet. Just created a group called "Web Signup".
I had it pointing to Test Group, and it was working.
Just checked and there were no entries in the Test Group. Can we please switch to "Web Signup"?
When I fill out the form and hit submit (Let's Dance), nothing happens on the live site. This is where I'll need some help on the validation and getting a success or thank you message?
I deleted my entries when I was done. It looks like something broke with it though...
Looks like it’s not working in Safari specifically. Chrome is good. I'll try some others too
Okay, found it...kick the tires a bit. Your contacts should be showing up now.
Perfect.
Flamenco was spelled wrong on the EMMA side, and it's been corrected. I'm not seeing the change on the front-side with the site however. I am assuming this would change automatically, correct? Or is there anything you need to do?
Yeah, I'll have to update the HTML.
Use this bad boy - https://gist.github.com/nerdpruitt/59fa0a9c77431ea15ba9