Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Form Action


Go to End


3 Posts   1626 Views

Avatar
ssguest

Community Member, 7 Posts

13 August 2015 at 4:13pm

My Form Action returns a DataList. The DataList is suppose to contain a string from a table in a database. When I submit my search text from the form I get a webpage that literally shows only the text 'DataList' but not the results from the ORM. My question is how do I show the ORM result in templates/layout/Page.ss?

Thank you very for any help.

Avatar
Pyromanik

Community Member, 419 Posts

13 August 2015 at 9:55pm

Edited: 13/08/2015 10:09pm

You need to iterate the List in your template.

eg. Instead of $Results
try something like:
<ul>
<% loop $Results %>
<li>$String</li>
<% end_loop %>
</ul>

Avatar
ssguest

Community Member, 7 Posts

14 August 2015 at 11:04am

Thank you very much Pyromanik I appreciate your help, it worked.