I have a form that haves a condition that sounds like that: If the client choose YES another form will appear, if is choosing NO, he can submit the form. But if he choose NO, the SUBMIT button stay down and it can be a little bit tricky. So, the question it is, what condition I have to put in that way that the submit button comes closer when the NO answer is choose?
Here is the part of the html code where the condition it is:
<div id="ifYes" style="visibility:hidden">
<div class="col-md-12 padding-top-10">
<h1 span style="color:red">If you need visa, please complete the following data:</h1></br>
</div>
<label for="firstName" class="control-label">Full name(as written in the passaport):</label>
<div class="form-group">
<div class="col-md-6 padding-top-10">
<input type="text" class="form-control" required data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-trigger="keyup" id="firstName" placeholder="First" />
</div>
<div class="col-md-6 padding-top-10">
<input type="text" class="form-control" required data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-trigger="keyup" id="lastName" placeholder="Last"/>
</div>
</div>
And here is the JS function:
function yesnoCheck() {
if (document.getElementById('yesCheck').checked) {
document.getElementById('ifYes').style.visibility = 'visible';
} else {
document.getElementById('ifYes').style.visibility = 'hidden';
}
}