Populate Site Title
-
Would it be possible to create a link where someone clicks it, then it would populate the title into the form once it loads?
Example: https://example.com/submission/?name={title}
-
Hi @jmeyer2485
I hope you are doing well today.
This should be possible with Pre-Populate Form Field Values
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#pre-populate-form-field-valuesExample:
1. You create form 1 and you place that on some posts which exist in some category, or you place that in the widget on the blog.That form 1 will have only one field: Hidden Field and set up as “Embed post/page title”.
2. You create a page where second form will be placed. Let call it “MY FORM”.
3. In form 1, in the Behavior tab you set up After Submission as “Redirect user to a URL”:
domain.com/my-form/?hidden={hidden-1}4. You create form 2 and you place a field, for example: INPUT. In that input Settings tab, you set up the Pre-populate section and enter the query parameter key you set for the field in the 1st form. In this case “hidden” as you can see on the screenshot in the above guide.
Kind Regards,
Kris@wpmudevsupport13 Thank you for the reply. I did read that section, but I don’t want to rely on two forms to populate data. Would like to have just a hyperlink that would populate the one form. Not sure this is possible from your solution.
Hi @jmeyer2485
There is no other solution in this case I’m afriad. Please note my solution does not generate full visible form for end user. Form 1 from my example will be only a button which you can treat as hyperlink on your pages (form 1 have only 1 hidden field so only a button is visible).
Kind Regards,
KrisHello @jmeyer2485 ,
I apologize for the confusion.
There is no need to use two forms. You need to use the pre-populate option https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#pre-populate and put the “name” or another word you have in the URL.
The field in the form with be prepopulated with the query.From your side, it is a matter of producing the link with the query.
kind regards,
Kasia@wpmudev-support2 Thank you, to expand on this would it be possible to automatically pull the page post title into the form?
Example: https://www.example.com/form?={title}
HI @jmeyer2485
That title should be title of the page on which the form is located or the page on which the link leading to the form is located?
If it’s the first option:
– put the hidden field on form
– and in it’s settings select “Embed Post/Page Title” option from “Default Value” drop-donwIf it’s the second option it would require some custom code and it depends on how do you put the link on the page. Is it just a regular link that you manually put on the page (via page editor) or is it somehow “coded into theme” or added some other way?
Kind regards,
AdamHi @jmeyer2485,
Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open the thread if you need further assistance.
Best Regards
Nithin
The topic ‘Populate Site Title’ is closed to new replies.