I have this structure:
<form action="/action_page.php" method="get">
<fieldset class="row row-1 active-slide">
<div class="form-group">
<label class="question">Initialen</label>
<input type="text" name="1" aria-invalid="false" placeholder="J." class="form-control">
</div>
<div class="form-group">
<label class="question">Tussenvoegsel</label>
<input type="text" name="2" aria-invalid="false" placeholder="Van" class="form-control">
</div>
<div class="form-group">
<label class="question">Achternaam</label>
<input type="text" name="3" aria-invalid="false" placeholder="Pijperzele" class="form-control">
</div>
<div class="form-group">
<label class="question">Geslacht</label>
<div class="radio-inline">
<label>
<input type="radio" name="4" value="Mannelijk"><span>Mannelijk</span>
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" name="4" value="Vrouwelijk"><span>Vrouwelijk</span>
</label>
</div>
</div>
<div class="form-group">
<label class="question">Geboortedatum</label>
<input type="text" name="6" aria-invalid="false" placeholder="DD-MM-YYYY" class="form-control">
</div>
<div class="form-group">
<label class="question">Telefoonnummer</label>
<input type="text" name="7" aria-invalid="false" placeholder="00 0000 000" class="form-control">
</div>
<div class="form-group">
<label class="question">E-mailadres</label>
<input type="text" name="8" aria-invalid="false" placeholder="[email protected]" class="form-control">
</div>
<fieldset class="row row-2">
<fieldset class="row row-3">
<fieldset class="row row-4">
and I need to check that all the fields are not empty but before the click of the submit button. I created multiple steps and I want to check it at the end of each step.
I wrote this IF:
if ($('input[name="1"]').val() == '' && $('input[name="2"]').val() == '' && $('input[name="3"]').val() == ''){
alert('complete all');
But it doesn't work correctly because if one of the fields are with a value it doesn't work(the behaviour is like a OR). What is wrong?