I am trying to accomplish something seemingly simple.
I would like to create a WordPress form field in which a user can enter an alphanumerical text. So far so good.
The challenge: This entry should be appended to the URL which is called when clicking the Submit button.
For example:
User enters: LookBlueElephants
On submit the user gets directed to http://www.example.com/LookBlueElephants
I am using the DIVI Builder and see that there is an option to enter the Redirect-URL in the form. Yet I do not know how to get it to be dynamic, based on the user input.
Thank you for your assistance. 🙂
2
Answers
Alright. After much tinkering, here the solution I took.
Created a form with Contact Form 7 and added Redirection for Contact Form 7 Plugin. With a plugin that allows inserting PHP code (for example Insert PHP Code Snippet) I added a simple redirect:
Just make sure that under Redirect Settings (in the Contact Form 7 settings) the box "Pass all the fields from the form as URL query parameters" is ticked.
Then create a new page where you insert the above code snippet (how that is done may depend on which plugin you use). Now enter the URL to that page into the Contact Form settings (Redirect Settings) and you're done.
The form will send the content of the form to the new page, the new page will take the GET variables and redirect to wherever you want.
Hope this will be of use to someone.
That’s exactly what I was looking for, thank you so much for your input.
After finding your solution, I tried a workaround using Elementor Pro Form that has after submit actions.
Save changes.
It then generates a link after submit like : wwww.yourdomain.com/whatever-you-wrote-on-field