Forum

Thread tagged as: Question

Definition lists - select list doesn't function

Here is my code:

<perch:content id="elective" type="select" options="May, Must" label="Elective Unit Composition" suppress="true" allowempty="true" />

<dl>

<perch:repeater id="units" label="Elective Units">

<dt><dfn><perch:if id="elective" value="May">The elective units may consist of:</perch:if><perch:if id="elective" value="Must">The elective units must consist of:</perch:if></dfn></dt>

<dd><span><perch:content id="unit" type="text" label="Unit" required="true" title="true" /></span></dd>
</perch:repeater>
</dl>
Garth Holmes

Garth Holmes 1 points

  • 6 years ago

If you are trying to access the value of the select inside the repeater, you need to include scope-parent="true" in your perch:repeater tag and then change the referenced ID inside the repeater to parent.elective.

<perch:content id="elective" type="select" options="May, Must" label="Elective Unit Composition" suppress="true" allowempty="true" />

<dl>
    <perch:repeater id="units" label="Elective Units" scope-parent="true">
<dt>
    <dfn>
            <perch:if id="parent.elective" value="May">The elective units may consist of:</perch:if>
            <perch:if id="parent.elective" value="Must">The elective units must consist of:</perch:if>
    </dfn>
</dt>
<dd>
    <span>
        <perch:content id="unit" type="text" label="Unit" required="true" title="true" />
    </span>
</dd>
</perch:repeater>
</dl>

Thank you for that guidance.