Modifying import code to use duplicate form on same page as original
-
Hi. I have a lengthy and complex form used for one purpose that I’ve duplicated and modified slightly for another purpose. Both need to be displayed on the same page but I’m noticing some display issues in the duplicated form. So far only selections not highlighting in a multi-select but I imagine others may crop up.
I’m guessing this is due to fields and other elements in the duplicated form using the same IDs as the original. I was thinking I’d modify the IDs in an export of the duplicate form’s code before importing it as a replacement.
Before I make any changes, though, I wanted to check that this was a) a good idea in the first place and b) if IDs are the only elements I need to make unique.
In this code:
{"type":"form","data":{"fields":[{"id":"radio-1","element_id":"radio-1","form_id":"wrapper-9028-7642",…
Would I only need to change
{"fields":[{"id":"radio-1","element_id":"radio-1"
to{"fields":[{"id":"radio-101","element_id":"radio-101"
?Or would the wrapper numbers and numbers following the
"key"
also need to be changed to something unique?Or can those be left alone and all instances of the
form_id
be changed to something different like"form_id":"wrapper-9028-7642"
to"form_id":"wrapper-9029-8190"
?I figure editing some IDs will be much faster than recreating the form. Any guidance is appreciated!
- The topic ‘Modifying import code to use duplicate form on same page as original’ is closed to new replies.