• 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: Dropdown from dynamic data

Dropdown from dynamic data 15 years 2 months ago #6472

Hi,
New RSForm Pro user here. I'm trying to make a dropdown list from dynamic data. I think once I get a basic list working I will be fine but I cannot seem to get the PHP code working correctly. I have tried to follow these two tutorials to get a list working:
from a table
from a file
But could not get either to work.

From the example code it looks like the $items string follows one of two conventions:
1) label(newline)label(newline) ...
2) value|label(newline)value|label(newline) ...

So I tried each case with simple data such as:
//
$items = "|Please Select[c]\\ntest|testval1\\ntest2|testval2\\n";
return $items;
//


The results in either case both in the preview window and on the actual form are that there are 3 items show like this:
//
return $items;
//
which of course is wrong. it simple makes the $items line disappear, and shows the remaining code as list items.

Any ideas?
Thanks in advance,
Reggie
The administrator has disabled public write access.

Re:Dropdown from dynamic data 15 years 2 months ago #6475

  • bogdan
  • bogdan's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 122
  • Thank you received: 4
Hi

You should try this to make it work:
//<code>
$items = "|Please Select[c]\\ntest|testval1\\ntest2|testval2";
return $items;
//<code>
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here

RSJoomla! Development Team
Last Edit: 15 years 2 months ago by bogdan.
The administrator has disabled public write access.

Re:Dropdown from dynamic data 15 years 2 months ago #6476

Thank you, that worked. It was missing the <code> tags.
Last Edit: 15 years 2 months ago by reggie.campbell.
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!