Hello,
I am using a PHP validation plugin (only in new records) in a dropdown element (element1 in table1) wich values are 0, 1 or 2.
I am having some troubles whit new records. I would like to have always value=2, if this is a new record.
I have this code:
$db = JFactory::getDbo();
if(empty($data)){
return '{table1___element1}' === '2';
}
else{
return false;
}
Could you help me, please? I think it?s basic, but i really don?t understand php code...
Thank you very much.!
I am using a PHP validation plugin (only in new records) in a dropdown element (element1 in table1) wich values are 0, 1 or 2.
I am having some troubles whit new records. I would like to have always value=2, if this is a new record.
I have this code:
$db = JFactory::getDbo();
if(empty($data)){
return '{table1___element1}' === '2';
}
else{
return false;
}
Could you help me, please? I think it?s basic, but i really don?t understand php code...
Thank you very much.!