Support » Plugin: Forminator - Contact Form, Payment Form & Custom Form Builder » Dynamic Selection of Form filed based on previous URL

  • Hi there,

    I am using Forminator on a client website.

    I want to build a registration form and have one field i.e. dropdown box dynamically populated based on which page is the form coming from.

    Exmaples:
    1) Page 1
    2) Page 2
    3) Page 3
    4) Registration Form Page

    All 3 pages will have a button which will be link to a registration page. The form on this page will have a dropdown name “Page URL”.

    If the user comes from page 1, then in the registration form dropdown automatically page 1 should be pre-selected.

    Same for page 2. If the user comes from page 2, then in the registration form dropdown automatically page 2 should be pre-selected.

    I want to avoid created multiple forms for different pages.

    Is there a way to get this done ?

    Any help will be appreciated.

    warm regards,
    – Meher

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Prathamesh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @meher,

    I’m afraid there is no way you can map the dropdown menus in such a way as of now but you can use the hidden field in the form with the default value set to HTTP Refer URL.

    Also to make this works correctly, you would need to keep in mind the following things:

    1. Links to the form from any page should not be opening in a new tab
    2. Forms-> Edit form-> Behaviour-> Method should be set to page reload
    3. Also, in the Behaviour section, Load from ajax switch should be turned off

    We have also seen that in many cases the referring URL would be blocked and in that case, embed URL would be used. With the above-suggested solution, you should be able to keep a track on which page did the member comes from. Here is a demo form which should show you the functioning.

    https://pastebin.com/Dbgf8zxv

    Should you have any doubts or need any help, feel free to reply in the thread here and we would be happy to help.

    Thank you,
    Prathamesh Palve

    Thread Starter Meher Bala

    (@meher)

    Thanks for the solution Prathamesh.

    Will try it out.

    Instead of a URL can we pass a value from one page to another?

    • This reply was modified 11 months, 2 weeks ago by Meher Bala.
    Plugin Support Prathamesh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @meher,

    I’m afraid I see that would not be possible as of now but I see it as a good feature which is why I would be sending this to the Forminator team to scope this up further and check if the same can be implemented but I would not be able to give you an ETA on the feature landing up for development or getting added to the plugin as the process of feature scoping gets through a lot of decision making which is where it would be decided by the team and the management if the same should be added to the plugin as a feature or not.

    Thank you for bringing this up with us here. Should you have any further suggestions, doubts or need any help, feel free to open a new thread and we would be happy to help.

    Thank you,
    Prathamesh Palve

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @meher

    I hope you are doing well.

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved.

    However, feel free to let us know if you have any additional question or problem.

    Best Regards
    Patrick Freitas

    Plugin Support Prathamesh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @meher,

    I checked this a bit deeply and made a few checks where I found that it is possible if you can pass a query parameter in the URL from where it comes to the form page. Let me explain this to you further on how to make it.

    Step One: Select the Hidden field and then select the Query Parameter option into it and define a query for example arrp.

    Step 2: Now considering your page from where the member is getting to the form page is https://yourdomainname.com/, I will add a query to the URL like this: https://yourdomainname.com/arrp=nameofthesourcepage and then use this link to link in the menu bar for example or any button or link from where you want the user to get to the form page.

    Now as the query parameter is defined and the URL already has the query, it will be picked up by the hidden field and you should ee the same in the submission. Now you can use any such query like /arrp=nameofthesourcepage or /arrp=nameofanotherpage to have the hidden field catch it.

    I hope this helps you with what you would currently like to achieve. Let me know if that works for you.

    Thank you,
    Prathamesh Palve

    Thread Starter Meher Bala

    (@meher)

    Hi Prathamesh,

    Thank you soo much for the detailed explanation.

    Let me try and see if I can replicate it at my end.

    Give me till Tuesday 20th Oct 2020 to revert back with more details.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Dynamic Selection of Form filed based on previous URL’ is closed to new replies.