Checkbox not working till I refresh
Hi,
- <label><input type="checkbox" id="chkAccept" name="chkAccept">I have reviewed this leave application</label>
and below jquery. I am trying to show / hide buttons when checkbox is checked on unchecked but it's working from the first time I load the page. I have to refresh to get it working.
- $(document).on("pagecreate", "#pagePendingReviewLeaveDetails", function(event)
- {
- $.validator.messages.required = "";
-
- $('#chkAccept').click(function ()
- {
- $("#btnAccept").toggle(this.checked);
- $("#btnDecline").toggle(this.checked);
-
- $('html, body').animate(
- {
- scrollTop: $(document).height()
- },
- 1500);
- return false;
- });
- });
Kindly help..
Thanks,