I would like to have a form with several input fields and use it on several pages instead of making a separate form for each page. How could I do that?
And to add here, seems like I can’t use the “Show on all pages” since
-
The form is not located in the same place on every page
-
The form shouldn’t be located in footer, header or mobile menu in mobile
Did anyone reply you?
Using one Form on multiple pages?
Your solution could be a poppig-up lightbox. With an Multi-State-Box inside it.
It’s not quite difficult if you think about it, all you need is a database (collection), with multiple ( Object ) fields, each one of which stores the data coming from a given page.
Database / Collection Schema:
- owner (Reference Field): A field to reference the owner of the data.
- page1 (Object): A field to store the data coming from page 1.
- page2 (Object): A field to store the data coming from page 2.
- page3 (Object): A field to store the data coming from page 3.
- etc…
On each page, you need to check whether the data from the previous page was submitted or not and redirect your visitors to that page if necessary.
Assuming your visitor landed on a page, that’s order is 3.
const data = await getData(); // Get the data with your prefered method.
const pageNum = 3; // The page num
// Check the previous page if the current page has no data.
if (!data[`page${pageNum}`]) {
const empty;
for (let i = 1; i < pageNum; i++) {
if (!data[`page${i}`]) {
empty = data[`page${i}`];
break;
}
}
if (empty) {
return { action: 'redirect', to_page: empty }
}
}
return { action: 'none' }
If the code above returned a “redirect” action, that means there are previous steps that have not been submitted yet and the first unsubmitted page is returned as the “to_page”.
Hope this helps~!
Ahmad
Hi Ahmad, Could you please email me.
Can explain how does it work on wix editor?
@smizzmy You can reach out to us at contact@nasriya.net
@ahmadnasriya Interesting who is that → “us” ←
@ahmadnasriya well done, well done team nasriya. But still did not found who is us. About-section do not open on mobile? Will test it later on PC.
@russian-dima because it doesn’t work