Forum

Thread tagged as: Question

Repeaters in a form template

I have a form set up with a dropdown selection with about 80 options (all set in the template). It would be good if the client was able to edit this list themselves. Is there a way of adding a repeater to the options attribute on the template?

Thanks

Matt Whetherly

Matt Whetherly 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

There's not, currently.

Ok, thanks Drew

Not sure if this solves the issue at all, but I have needed this functionality once and simply used a text area without formatting to allow users to add options, with a hint that they need to separate with a comma. I know with 80 options its not the best solution but may help...

<perch:input type="select" options="<perch:content id="options" type="textarea" label="Options" help="Separate with commas" />" />

Hi Liam, I just tried this, unfortunately it doesn't show up in the backend. Thanks anyway

Hi Matt,

Not sure if I simply glitched the system one time for it work heh, I didn't use perch_form('Form') and instead called my form using perch_content('Form') - not sure if that makes a difference.

For example, I have a form.html in my templates/content folder which has my form including the code from above.

Then I simply assign this template to the perch_content('Form'); on the page I need to the form to appear on.

It's currently using perch_member_form('register.html') (it's using the forms app). Do you know if it is likely to work with perch_content?

I'm having to do this on a live site (post launch request :/ ) that I didn't build so I'm just making sure. If not I'll just have to download it all and try it locally

Oh, its the members app, I am not too sure then. I have tried it with just the bog standard form app and it worked alright. I would like to hope it could work in the same way, but I can't say for certain as I have never used the members app that much.

I would recommend downloading it and testing it locally, incase it does break anything that is live. :)

No worries, thanks anyway. I'll download it when I get the time and let you know if it works.

No problem, hope it all works out ok.