PHP method output is not displaying in form field

Hello Guys,

I am working on a form application and have a label field in which I have to display custom html that I written in a PHP function. The field is of label data type and have name as ‘data’. A new PHP method is created in Programming section having a HTML code. When I run the form, the HTML code displaying before header of form starts. :confused:


A PHP function test()
===============
echo "<div>This is div for testing</div>";



onLoad Event of form
================
{data} = test();


This is the what I did, which way is it better to do?


Milind Wakale

Yes, echo is just echoing the data. It’s a php statement which pushes the text into the io channel in stead of filling your scriptcase variable. So it should be something like:


function test()
{
  $r="<div>This is div for testing</div>"; 
  return $r;
}

onLoad Event of form
================
{data} = test();  

Thanks, this is working perfectly.