Forums

i cannot get any data from textbox

samir1903 04 Nov, 2018
custom code
<?php
$form->data['total']=$form->data['field1']+$form->data['field2'];
?>
debug
Array
(
    [option] => com_chronoforms5
    [chronoform] => deneme
    [event] => submit
    [field1] => 1
    [field2] => 2
    [total] => 0
    [button4] => Submit
)

why can i not get any value from field???
GreyHead 04 Nov, 2018
Hi samir1903 ,

The PHP looks OK for CFV5. If you test with just $form->data['total'] = '999'; does that work?

Bob
GreyHead 04 Nov, 2018
Hi samir1903,

Hmm that's odd - the full expression should also work.

Please take a Form Backup using the icon in the Forms Manager and post it here and I'll take a closer look.

Bob
healyhatman 04 Nov, 2018
$fieldvalue = $this->data("fieldname", "default if empty");
This topic is locked and no more replies can be posted.