Hi All,
I can't get the following to work and can't find the answer in the forum.
What I want is this. In the form I'd like to have a hidden textbox with the current year in it's value.
Of course I can keep changing the year every time the form gets online but I'd like to have it dynamic with a php Date() function.
Now the little script <?php echo Date('Y') ?> worked in V4 when put into the value field of the hidden textbox but somehow it doesn't seem to work in V5.
I also tried to use the extra parameters box with value=<?php echo Date('Y') ?> but then the first value is empty and I can't get the Year value in the database when saving.
Can anyone please help?
Grtz
Arkomat
I can't get the following to work and can't find the answer in the forum.
What I want is this. In the form I'd like to have a hidden textbox with the current year in it's value.
Of course I can keep changing the year every time the form gets online but I'd like to have it dynamic with a php Date() function.
Now the little script <?php echo Date('Y') ?> worked in V4 when put into the value field of the hidden textbox but somehow it doesn't seem to work in V5.
I also tried to use the extra parameters box with value=<?php echo Date('Y') ?> but then the first value is empty and I can't get the Year value in the database when saving.
Can anyone please help?
Grtz
Arkomat
Hello Arkomat,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Date control using CFv5 date picker element
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Date control using CFv5 date picker element
P.S: I'm just an automated service😉
Unfortuntely that's not what I mean. I just want the value "2014" for this year (and autmatically "2015" next year) in the value field of the hidden text box.
Grtz
Arkomat
Grtz
Arkomat
I solved the problem with this thread "http://www.chronoengine.com/forums/posts/t97393/p335513/set-textfield-value-from-php.html#p335513".
In "Setup" I added a "Custum code" event before the "HTML (Render Form)" event in the "OnLoad" Section.
In the "Custum code" event I added the following code:
This resulted in:
In "Setup" I added a "Custum code" event before the "HTML (Render Form)" event in the "OnLoad" Section.
In the "Custum code" event I added the following code:
<?php $form->data['speeljaar'] = Date('Y');?>
(where "speeljaar" is the "Field ID" for the hidden field)
This resulted in:
<input name="speeljaar" value="2014" id="speeljaar" type="hidden" class="form-control A" />
when looking at the page source code.
This topic is locked and no more replies can be posted.