How to set custom value to {{{value fieldname}}} in custom template

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
kirpalsinghsh206
User
Posts: 7

How to set custom value to {{{value fieldname}}} in custom template

Post by kirpalsinghsh206 »

<div class="col-sm-4">
            <div class="fw-bold p-2">{{{caption ACTIVITY_TIME_1}}}</div>
            <div class="p-2">{{{value ACTIVITY_TIME_1}}}</div>
 </div>

I am using custom template for add page and it works just fine, but i wish to set the ACTIVITY_TIME_1 to a specific date and time on load for add page.

I tried:
<div class="p-2"><?php date('d-F-Y 09:00:00'); ?></div>

I also tried setting in page render for add/copy page.

$this->ACTIVITY_TIME_1->CurrentValue = date('d-F-Y 09:00:00');
$this->ACTIVITY_TIME_1->ViewValue = date('d-F-Y 09:00:00');

None works


arbei
User
Posts: 9286

Post by arbei »

kirpalsinghsh206 wrote:

<div class="p-2"><?php date('d-F-Y 09:00:00'); ?></div>

You need to echo it out, e.g.

<?= date('d-F-Y 09:00:00'); ?>

(Setting ViewValue should also work.)


kirpalsinghsh206
User
Posts: 7

Post by kirpalsinghsh206 »

I tried with <?= echo date('d-F-Y 09:00:00'); ?> but the value input field disappeared, its left with caption


arbei
User
Posts: 9286

Post by arbei »

arbei wrote:

<?= date('d-F-Y 09:00:00'); ?>


Post Reply