Return false to maybe prevent early form submit (#531)

This commit is contained in:
Andy Zhao 2018-07-10 15:37:07 -04:00 committed by Ben Halpern
parent 41d028cc5a
commit aab350f02b

View file

@ -286,6 +286,7 @@
form.submit();
} else {
document.getElementById('js-error').innerHTML = 'Oops, something went wrong. Please refresh the page or contact <a href="mailto:members@dev.to">contact us</a> to get this sorted out.'
return false;
}
}
});
@ -298,6 +299,7 @@
function openStripeForm() {
if (getAmount() < 100) {
document.getElementById('js-error').innerHTML = 'Amount has to be at least 1 dollar.';
return false;
} else {
document.getElementById('js-error').innerHTML = '';
addHidden(form, 'amount', document.getElementById('amount-input').value);