date defaults to 1 hour +

hjkok50

Member
Hello,
Can anybody help me out with some php to set a default value in a date field?

I want to add one hour to the value of another field called 'activiteit___van', so I tried several php statements in de default box. Latest settings are:

$v=JRequest::getVar('activiteit_van');
$time=strtotime("+1 hour");
$t=date($v,$time);
return $t;

no result whatsoever.

What am I doing wrong?

thanks for responding,

Henk
 
I resolved the issue myself. It turns out that I should have used a Javascript to reset the value of a date based on the typed-in value of an other date field, instead of setting the default value in php.

The following code does the job:
action = select
var tot = form_nn.formElements.get('tablename___fieldname').getValue();
var res = form_nn.formElements.get('tablename___fieldname').update(tot);

good luck

Henk
 
BTW, was this really a Fabrik 1.0.x issue?

If not, can you tell me what version of Fabrik you are using, and I'll move th thread to the appropriate forum. We no longer even display the 1.0 forums in our available list, we just left the content online for any external links that exist to them.

-- hugh
 
hello hugh,

no it was not a Fabrik 1.0.x issue. I'm using Fabrik 3.0.7 now, so probably I posted it on the wrong forum origianally. My apologies for that.

Henk
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top