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();
};
}
Can someone help me?
Thank you!
Fabiano