Page 1 of 1

set multiple conditions which, if they occur together, make two checkbox fields disabled

Posted: 2020-06-28 16:49
by fgazza
Hi everyone.
I have two checkbox fields named field1 and field2 and a calculated field named is_complete.
I wish if the condition 1 and 2 and 3 are all true the fields field1 and field2 become disabled.

Here are the condition 1, 2 and 3:
1) the logged in user does not belong to the Admins group and does not belong to the Admins2 group
2) the record was created more than 5 minutes ago
3) the value of is_complete is "1"

I prepared this code:

Code: Select all

if ($memberInfo['group'] != 'Admins' && $memberInfo['group'] != 'Admins2'){
			if($creationDate < strtotime('5 minutes ago')) {
			ob_start();
			?>
			<script>
				$j(function() {
					$j('#field1').attr("disabled", true);
				})
				$j(function() {
					$j('#field2').attr("disabled", true);
				})
			</script>
			<?php
			$html .= ob_get_clean();
		};
		
	}
but I don't know if it's right and I don't know how to add the condition "if is_complete" = "1"

Can someone help me?

Thank you!

Fabiano