How to do Client Side OnCheckChanged event for ASP.Net CheckBox using JavaScript

Category > ASP.NET || Published on : Friday, August 25, 2017 || Views: 8171 || Client Side OnCheckChanged event ASP.Net CheckBox using JavaScript


Introduction

Here Pawan Kumar will explain how to How to do Client Side OnCheckChanged event for ASP.Net CheckBox using JavaScript

Description

In previous post I have explained Top Popular Open Source .Net Projects - Websites/Portals : Portal/CMS, MySQL Tutorial, Mvc 4 Razor CRUD Operation using C# || ASP.NET MVC 4 application to Create/Insert,Read,Update,Delete and Search functionality using Razor view engine and Entity Framework, Top Popular Open Source E-Commerce ASP.Net Projects, Calculator in Winform DotNet using C Sharp, Swapping of two numbers without using third variable using dotnet with c sharp, and many more articles.

Now I will explain How to How to do Client Side OnCheckChanged event for ASP.Net CheckBox using JavaScript

So follow the steps to learn How to do Client Side OnCheckChanged event for ASP.Net CheckBox using JavaScript

<script type="text/javascript">
    function ShowHideDiv(chkPassport) {
        var dvPassport = document.getElementById("dvPassport");
        dvPassport.style.display = chkPassport.checked ? "block" : "none";
    }
</script>
<label for="chkPassport">
    <asp:CheckBox ID="chkPassport" Text="Do you have Passport?" runat="server" onclick="ShowHideDiv(this)" />
</label>
<hr />
<div id="dvPassport" style="display: none">
    Passport Number:
    <asp:TextBox ID="txtPassPort" runat="server" />
</div>

 

Conclusion:

So, In this tutorial we have learned, How to do Client Side OnCheckChanged event for ASP.Net CheckBox using JavaScript