I am trying to check the status of a checkbox, but it is not working. No mater what the state of the check box is, it returns a 1.
https://gist.github.com/tmoore88/37586037e55ec0eafe952b6eb8e67a42
if I REM out lines 5 and 6, then it works. it reads as 1 or 0. Am I doing something wrong?
Thanks, Tim
3 Answers
To check the checkbox status using jQuery, Use following:
https://stackoverflow.com/a/6438222/385377
if ( $('#checkboxid').is(':checked') ) { ... }
In your code your check_po() function should be like following:
<script>
function check_po(formid)
{
ck_prod_cop = jQuery("input[name=ck_prod_cop]:last, select[name=ck_prod_cop]:last",formid).is(':checked');
if (ck_prod_cop)
{
return true;
}
}
</script>
Your Answer

