Use field value in php

Access field values in PHP within ChronoForms admin edit.

Overview

The issue occurs when using the incorrect variable to retrieve form data in the admin edit context.
Replace the $form->data variable with $row to correctly access the field values.

Answered
we webcrea 29 Apr, 2015
Hello,

In admin edit, I try to use a value of the field

<?php
$image = $form->data['Honor']['image'];
echo "image = " . $image;
?>

model is Honor and the field text is image with a name of the image in

I have

image=NULL

the value appears correctly in html with {Honor.image}

an idea please?
thanks
chris
Gr GreyHead 29 Apr, 2015
Answer
Hi chris,

In CC please use $row instead of $form->data. So I think that it is $row['Honor']['image']

Bob
This topic is locked and no more replies can be posted.