I have my form which consist of one master form and 2 details parts which on two different tab (submit button is on only main form outside tabs.). I am trying to submit master form with only active tab(either first tab or 2nd tab) form with single click. Currently when i submit try to submit data with active tab only, then its not submitted until mandotry fields of inactive tab are fill here is the code :
`<form method="POST" action="abc.php">
<input type="text" name= "mrno" id= "mrno" > <br>
<input type="text" name= "name1" id= "name1" > <br>
<div class="tab">
<button class="tablinks" type="button" onclick="openCity(event, 'London')">Value Range Result</button>
<button class="tablinks" type="button"onclick="openCity(event, 'Paris')">Fixed Test Result</button>
</div>
<div id="London" class="tabcontent">
<input type="text" name= "maleage" id= "maleage" > <br>
<input type="text" name= "maleedu" id= "maleedu" > <br>
</div>
<div id="Paris" class="tabcontent">
<input type="text" name= "femage" id= "femage" > <br>
<input type="text" name= "femedu" id= "femedu" > <br>
</div>`
Java script code
`<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
<input type="submit" name="submit" id="submit" value="Submit">
</form> `