Forum

Thread tagged as: Question, Problem, Forms

Multiple forms on same page

Hi there. I've got a region with multiple items, and each item contains a form, so it outputs numerous forms on the same page. Perch automatically adds the formX prefix to each one which is great so my IDs don't get duplicated. However, I need the form IDs to stay fixed for each form. So the problem comes if I reorder the multiple items, at which point the form IDs change round (so "form1" is always the first form in the page basically).

Obviously I could just not reorder them, but there are editors with access who may do this without knowing.

Any suggestions? Thanks!

Stephen Turvey

Stephen Turvey 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Why do the IDs need to be fixed, out of interest?

You can specify your own prefix in the template using the prefix attribute on the form tag: https://docs.grabaperch.com/docs/form/template-tags/form/

Because I've got the forms hooked up to a custom app which uses those IDs.

If I create my own prefix it's still going to append numbers to it and change them around on reorder isn't it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You shouldn't need to know the IDs - the API abstracts that away.