Forum

Thread tagged as: Problem, Forms, Field-Types

Suppress attribute not working for repeater tags

I created a region to add options for a select input, which included a default option (see below). However in the backend, the default option text field is repeated with each new item.

select-options.html

<perch:repeater id="select_options" label="Select Options">
    <perch:before><perch:content id="default_option" suppress value="true" />|</perch:before>,<perch:content id="option" type="text" label="Select option" />|<perch:content id="option" type="text" label="Option Text" required format="LC" replace=" |-"/>
</perch:repeater>

So I amended the template to suppress the field inside the repeater (see below), but this didn't work and there are now blank text fields (see https://drive.google.com/file/d/1zRoARECg455zBPKIONzODn5tXGxyYZUt/view?usp=sharing)

select-options.html (amended)

<perch:content id="default_option" type="text" label="Default Option Text" required />
<perch:repeater id="select_options" label="Select Options">
    <perch:before><perch:content id="default_option" suppress value="true" />|</perch:before>,<perch:content id="option" type="text" label="Select option" />|<perch:content id="option" type="text" label="Option Text" required format="LC" replace=" |-"/>
</perch:repeater>

Is there any way to fix this?

Also I can't get the replace attribute to work. I want to replace spaces with a hyphen. Should I use unicode?

Neal Hanson

Neal Hanson 0 points

  • 1 week ago
Drew McLellan

Drew McLellan 2624 points
Perch Support

Rather than putting the default option in the before, put it outside the repeater.