mardi 12 juin 2018

How to Hide and Show a Div while OnBlur and OnFocus event in asp.net textbox?

<div class="form-group row">
            <div class="col-md-3">Add Tags</div>
            <div class="col-md-3">
                <asp:TextBox runat="server" ID="txtAddTags"  >

                </asp:TextBox>
            </div>
            <div class="col-md-6" id="TagList" >
            <div class="row">
            <div class="col-sm-4 ">
                <ul>
                     <ol><input type="checkbox" class="chkbox" value="c" />c</ol>
                     <ol><input type="checkbox" class="chkbox" value="c#" />c#</ol>
                                                                 </ul>
            </div>
            <div class="col-sm-4">
                <ul>
                      <ol><input type="checkbox" class="chkbox" value="angular" />angular</ol>
                      <ol><input type="checkbox" class="chkbox" value="react" />react</ol>

                </ul>
            </div>
            <div class="col-sm-4">
                <ul>
                <ol> <input type="checkbox" class="chkbox" value="unity" />unity</ol>
               <ol> <input type="checkbox" class="chkbox" value="docker" />docker</ol>
                 </ul>
            </div>
            </div>
            </div>
        </div>

The Above code is my aspx code.I want that when some focus on the textbox having ID=txtAddTag then the div containing the checkbox Having Id=Taglist list will appears

<script>
    $(document).ready(function () {
        $('#<%=txtAddTags.ClientID%>').blur(function ()
       { $("#TagList").hide() });
       $('#<%=txtAddTags.ClientID%>').focus(function ()
       { $("#TagList").show() });
   });
</script>

Above is My Javascript code

I am not sure for the code..Plz help




Aucun commentaire:

Enregistrer un commentaire