I'm trying to validate a contact form and I want to create some sort of 'form completed' message once every input field has been filled in (some of the inputs are text boxes, some are radio buttons).
Here's my code so far:
$(document).ready(function() {
$('.form:input').each(function() {
if ($(this).val() != "") {
$('.congrats').css("display", "block");
}
});
});
p.congrats {
display: none;
}
<div class="form">
<input type="text" />
<br />
<input type="text" />
</div>
<p class="congrats">Congrats!</p>