Issue with read-only condition

QuestionsIssue with read-only condition
Tim Moore asked 3 years ago

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
Abu Ghufran Staff answered 3 years ago

To check the checkbox status using jQuery, Use following:

https://stackoverflow.com/a/6438222/385377

if ( $('#checkboxid').is(':checked') ) { ... }
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 3 years ago

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>
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Tim Moore answered 3 years ago

This was the issue, thanks

Tim

Your Answer

1 + 2 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?