• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: coding in fields

coding in fields 16 years 6 months ago #5142

  • xaddict
  • xaddict's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,

I'm trying to create a form with some pre-generated values (a few GET parameters, which I'd like to handle with the Jrequest class)
Now I've seen some examples of php code inside a form on the forum but i can't get a simple thing like:
$var1=\"hi!\";
echo $var1;

to work...

Where should the php script be to be processed and how can I display a returned value inside a field of the form?
The administrator has disabled public write access.

Re:coding in fields 16 years 6 months ago #5164

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

In the Default value of the component, you can insert PHP code like this:
//<code>
$var1=\"hi!\";
return $var1;
//</code>

Please note that the //<code> tags are mandatory.

Post edited by: strafe, at: 2008/10/21 10:14<br><br>Post edited by: strafe, at: 2008/10/24 12:18
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re:coding in fields 16 years 6 months ago #5232

  • xaddict
  • xaddict's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I'm using the code you gave to fill a input field but somehow the variable doesn't end up in the field but it ends up before the form.
any suggestions of what I'm doing wrong?
The administrator has disabled public write access.

Re:coding in fields 16 years 6 months ago #5233

  • octavian
  • octavian's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 783
  • Thank you received: 110
Hello,

Actually i've mistyped - it should have been return instead of echo. I've edited my post, try it now, it should work without any problems.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!