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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1222 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')
);