function EnableDisableTextBox(chkPassport) {
var txtPassportNumber = document.getElementById("txtPassportNumber");
txtPassportNumber.disabled = chkPassport.checked ? false : true;
if (!txtPassportNumber.disabled) {
txtPassportNumber.focus();
}
}
<html>
<body>
<label for="chkPassport">
<input type="checkbox" id="chkPassport" onclick="EnableDisableTextBox(this)" />
Tab?
</label>Tab Quantity:
<input type="text" id="txtPassportNumber" disabled="disabled" />
<br>
<script type="text/javascript"></script>
<label for="shoes">
<input type="checkbox" id="shoes" onclick="EnableDisableTextBox(this)" />
Shoes?
Shoes Quantity:
<input type="text" id="txtquant" disabled="disabled" />
<br />
<label for="tshirt">
<input type="checkbox" id="tshirt" onclick="EnableDisableTextBox(this)" />
Tshirt?
</label>
Tshirt Quantity:
<input type="text" id="polo" disabled="disabled" />
</body>
</html>
abim usman 0 Newbie Poster
kgweb 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.