[SOLVED] Form PHP - count changes on date element

Status
Not open for further replies.

bea

Active Member
Hi,
I've been using a script in F2 for a long time, but in F3 it doesn't work. I've made some changes, but it counts always. What I'm doing wrong??
Cheers,
Bianka

PHP:
<?php
defined('_JEXEC') or die();

$origData = $formModel->getOrigData();
$checkdate = $formModel->getElementData('fab_cp1_aktionsplan___checkdate');

if (!empty($origData[0]) && $origData[0]->fab_cp1_aktionsplan___checkdate != $checkdate );

{$count = (int)$origData[0]->fab_cp1_aktionsplan___counter + 1; 
$formModel->updateFormData('fab_cp1_aktionsplan___counter', $count, true); 
$formModel->updateFormData('fab_cp1_aktionsplan___counter_raw', $count, true);}
?>
 
Where do you have this code?

I don't think there should be a ;
...$origData[0]->fab_cp1_aktionsplan___checkdate !=$checkdate );

Did you try to dump (with jDump extension) or var_dump
$origData and $checkdate etc?
 
  • Like
Reactions: bea
Hi troester,
you are the best! The semicolon (;) was wrong.
I've tried to dump all data before I wrote this post and everything was correct.
Many thanks.
Bianka
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top