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

print checkbox value in my page


Go to End


1456 Views

Avatar
bebabeba

Community Member, 193 Posts

12 November 2008 at 3:24am

Hi!
I must take the value (or values) choose in a checkbox and print in my page. What I wrote is wrong, can you help me to correct?

new CheckboxSetField(
$name = "categoria",
$title = "Categoria:",
$source = array(
"1" => "5L stelle",
"2" => "5 stelle",
"3" => "4 stelle",
"4" => "3 stelle"
)

function doRicettivita($data, $form) {
if(!empty($data['nome'])) //this is a textfield
{ $data = array('Nome' => $data['nome'], 'Categoria' => $data['categoria']);
}
//return $a;
return $this->customise($data)->renderWith(array('SearchPage_results', 'Page'));