button click event required an extra logic gate

pull/4/head
joates 10 years ago
parent 6b27d611fa
commit 633cf0b69a

@ -15,7 +15,8 @@ process.nextTick(function() {
document document
.getElementById("signup-form") .getElementById("signup-form")
.addEventListener("click", function() { .addEventListener("click", function(e) {
if (e.srcElement.nodeName === 'BUTTON') {
if (input_email && input_email.value) { if (input_email && input_email.value) {
var is_valid = check_email(input_email.value) var is_valid = check_email(input_email.value)
if (is_valid) { if (is_valid) {
@ -23,7 +24,8 @@ process.nextTick(function() {
form.submit() form.submit()
} else { } else {
input_email.value = '' input_email.value = ''
alert("that doesn't look like an email address, please try again...") alert("that doesn't look like an email address,\nplease try again...")
}
} }
} }
}) })

Loading…
Cancel
Save