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.

Archive /

Our old forums are still available as a read-only archive.

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

multivalue array with TextField


Go to End


2 Posts   1396 Views

Avatar
ojalà

Community Member, 87 Posts

17 October 2008 at 11:36pm

I have this functione that show me form. I have need of 3 form, How can iterate TextForm value ($name, $title, $value)?

function BrowserPollForm() {
// Create fields
$fields = new FieldSet(
new TextField(

$name = "name",
$title = "numero di notti",
$value = "1"

)
);

Avatar
Willr

Forum Moderator, 5523 Posts

19 October 2008 at 3:51pm

What are you trying to do? Get 3 text fields? You should just do

$fields = new FieldSet(
new TextField('Field1'),
new TextField('Field2'),
new TextField('Field3')
);