What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Is there a way to change the form's recipient using URL parameters?Asked by MetalSupport on July 24, 2015 at 09:48 AM
I would like to have one form that sends out the submissions to different e-mail addresses based on an URL parameter. I know about the Conditions feature, but this would require me to add an additional field to my form, such as "pick a recipient" which I would like to avoid. Is there a way to do this?
Thanks in advance for your help!
If the URL parameter is pulled from the JotForm URL, it can be possible by adding a hidden textbox field on the form.
For instance, if the JotForm URL is having an additional parameter as below
you can have the parameter value in the hidden textbox field which is placed on the form by placing a simple PHP command.
While previewing the form with added parameter in the URL, the form should display the value as below :
You may and a condition can be set based on this textbox field to send the email.
Please see the demo form below. You may also clone it to your account to see how it works.
Hope this information helps. Let us know if you need any further assistance. Thanks!
Thanks for your assistance,
I input the code as instructed but the form does not auto fill with the parameter? any idea why?
Generally, the field names are assigned automatically by label name of the field. However, this can be altered from the field properties. Since the label is set to test on your JotForm, the field ID was assigned as test.
The URL should be working fine if the parameter is changed to test without making any changes to your JotForm now.
But the field is assigned to call a different variable 'city' and in the URL parameter. Please replace the field name from test to city so that the URL should be working fine.
Once this change is made on your JotForm, you should be able to access with the parameter city.
Hope this information helps.