javascript - how to use onClick() on checkbox in jsp page -
how use onclick() event within jsp page on checkbox. here code , keeps giving me errors when have onclick() event in code.
js:
function togglediv(tokencheckbox) { if (tokencheckbox.checked == true) { document.getelementbyid("cardno").style.display = "none"; document.getelementbyid("token").style.display = "block"; } else { document.getelementbyid("cardno").style.display = "block"; document.getelementbyid("token").style.display = "none"; } }
jsp:
html:checkbox property="returntoken" onclick="togglediv(this)"
it should >> <input type="checkbox" onclick="togglediv(this)">
this wrong >> <html:checkbox property="returntoken" onclick="togglediv(this)">
even if jsp, way declare html remains same.
could please explain how use <html:checkbox>
?
regards,
Comments
Post a Comment