JSFiddle - React, Tailwind, and code Playground
by Arnaud
HTML
<form action="" method="post" name="form" id="form">
<input type="text" placeholder="Your email*" name="email" id="email">
<input type="text" placeholder="Your name*" autocomplete=off name="name" id="user_name">
<button type="submit" id="signup" value="Sign me up!">Sign Up</button>
</form>
JavaScript
$('#form').submit(function() {
if ($.trim($("#email").val()) === "" || $.trim($("#user_name").val()) === "") {
alert('you did not fill out one of the fields');
return false;
}
});