vendredi 7 juillet 2017

How can hide the textbox on basis on checkbox in JSP

In my JSP page two fields one is textbox and one is checkbox, I tried with j query and java script also for hiding the textbox on checked of checkbox but it is not reflecting. Below I am mentioning code here

<p class="contact"> <input id="check" name="check" value="check" style="margin-right: 10px" type="checkbox" tabindex="11">
        <label for="name"> Not Yet Registered</label> </p>


        <p class= "reg"><label for="reg">Register No.</label></p><br>
        <input id = "reg" maxlength="15"  name= "reg" placeholder="Reg No." type ="text" tabindex="12"><br><br>

J query

$('#check').click(function() {
  $('.reg')[this.checked ? "hide" : "show"]();
});

Kindly Help me out

Aucun commentaire:

Enregistrer un commentaire