Radio buttons within forms

Radio buttons within forms

Wednesday 16 April 2003 12:07:17 am - 2 replies

Author Message

Jan Borsodi

Wednesday 16 April 2003 1:29:15 am

Had you used enum you would been able to get radiobuttons by choosing it in the class edit.

Using other datatypes (int,string) requires some custom template code. If you know the identifier of the attribute you can access it directly and generate the radioboxes.

Example:
{let myattribute=$node.data_map.myidentifier}
{section name=Radio loop=array('Accounts','Sales')}
<input type="radio" name="ContentObjectAttribute_ezstring_data_text_{$myattribute.id}" value="{$:item}">{$:item}</input>
{/section}
{/let}

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Paul Forsyth

Wednesday 16 April 2003 1:51:47 am

Thanks Jan,

I tried out both methods.

I didn't realise that by selecting the enum to be a checkbox i would get radio buttons... Maybe the text needs modified as there is a checkbox datatype.

When i tried attribute_edit_gui the design format it displays wasnt to my liking so I used your second method as ive kept the attribute as a non-enum. Using a enum and going into it to pull out elements for my own design would have been messier code. but each to their own. Im still getting used to form building within ez3 :)

Thanks again, Jan.

Paul

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.