Setting options

The simplest way to set options is with a basic string of options separated by a comma. Perch will then use each item in the string as both the visible label for that radiobutton and the value that gets written to your HTML.

options="House, Apartment, Room-share"

Sometimes you might want to have something different displayed to the editor than gets written to the HTML. For example, the value may be used for a class attribute that needs to be lowercase with no spaces, but you want to present the choice more attractively formatted in the edit form.

You can provide a value to write to the HTML for each item by using a | character. The order is nice label first, followed by | followed by the value that gets written to the template.

options="House|house, Apartment|apartment, Room-share|roomshare"

Report a problem with this page

Let us know of problems or improvements that could be made to this page. This isn't for getting support - post to the forum for that.