actually I am confused about how to validate every single field of my date
<div class='p-0 m-0'>
<label class='form-label QstFonts mx-5'>What is your date of birth?</label>
<div class='mt-5 mb-2 d-flex align-items-center justify-content-center'>
<input
asp-for='HLApplication.Day'
id='txtbox1'
onkeyup="GnderTextboxsValidation('txtbox1','txtbox2','txtbox3','genderButton')"
class='input-text col-lg-3 col-2 m-lg-2 m-2 py-4'
requird
maxlength='2'
placeholder='DD'
/>
<span> / </span>
<input
asp-for='HLApplication.Month'
id='txtbox2'
onkeyup="GnderTextboxsValidation('txtbox1','txtbox2','txtbox3','genderButton')"
class='input-text col-lg-3 col-2 m-lg-2 m-2 py-4'
requird
maxlength='2'
placeholder='MM'
/>
<span> / </span>
<input
asp-for='HLApplication.Year'
id='txtbox3'
onkeyup="GnderTextboxsValidation('txtbox1','txtbox2','txtbox3','genderButton')"
class='input-text col-lg-3 col-2 m-lg-2 m-2 py-4'
requird
maxlength='4'
placeholder='YYYY'
/>
</div>
<div class='row p-0 m-0'>
<div class='col-12 p-0 m-0'>
<div class='p-0 mx-5 row m-auto d-flex'>
<button
id='genderButton'
disabled
type='button'
onclick="HairLossClick('37','38'); SubmitForm();"
class='btn btn-primary my-lg-4 my-1 py-3 h-25 m-auto'
>
Continue
</button>
</div>
</div>
</div>
</div>;
the following code is for disable and enable btn on basis of textboxs
function GnderTextboxsValidation(txtbox1, txtbox2, txtbox3, Button) {
if (document.getElementById(txtbox1).value === "" ||
document.getElementById(txtbox2).value === "" ||
document.getElementById(txtbox3).value === "") {
document.getElementById(Button).disabled = true;
} else {
document.getElementById(Button).disabled = false;
}
}
this is my js party now i'm only checking if field is empty i disable button