Hi
I have tried following examples in other faqs to add a string to a text field using custom code in chronoforms6. I have a text field called 'job' in my form and in the settings, I have created a custom code element in the load section above the display section. My code is:
<?php
$uri=@$_SERVER[HTTP_REFERER];
$pos = strrpos($uri, '/');
$id = $pos === false ? $uri : substr($uri, $pos + 1);
$form->data['job'] = $id;
echo $id;
?>
When I open the form, the string is echoed ok, but the value does not appear in the job field. Any idea what I am doing wrong?
Thanks
Jim
I have tried following examples in other faqs to add a string to a text field using custom code in chronoforms6. I have a text field called 'job' in my form and in the settings, I have created a custom code element in the load section above the display section. My code is:
<?php
$uri=@$_SERVER[HTTP_REFERER];
$pos = strrpos($uri, '/');
$id = $pos === false ? $uri : substr($uri, $pos + 1);
$form->data['job'] = $id;
echo $id;
?>
When I open the form, the string is echoed ok, but the value does not appear in the job field. Any idea what I am doing wrong?
Thanks
Jim