Load form with prefilled fields via link - how?

More
14 Jun 2017 17:56 - 27 Jul 2017 18:30 #11 by gba
Hi!

Thank you, I got your e-mail.
I will be able to give it a try next week.

Kind regards,
Gerald

Please Log in or Create an account to join the conversation.

More
14 Jun 2017 17:58 #12 by Demis [Fox-Labs]
Replied by Demis [Fox-Labs] on topic Load form with prefilled fields via link - how?
Do it when you want, I just wanted to ensure that you have received the package. :)

Please Log in or Create an account to join the conversation.

More
19 Jul 2017 00:05 - 19 Jul 2017 00:14 #13 by Demis [Fox-Labs]
Replied by Demis [Fox-Labs] on topic Load form with prefilled fields via link - how?
Hello Gerald,
first of all you have to create a link to the form page.
There is no need to use a plugin, just put the http link as HTML into your article, or whenever you want:
http://yoursite/contact-us.html?parameter1=value1&parameter2=value2&...
The parameters vary based on the fields you want to automatically fill out, and must be separated by a '&', as per w3c specifications, since it is a query string .

The parameters take their names from the ID of the fields, which can be found in the back-end, among the other field properties.
Important: despite the field ID is the back-end is shown in camel case (eg: TextArea1), you must specify it in lowercase for auto-fill purpose (eg: textarea1). Camel case will not work.

Spaces and special characters in the values, must be encoded, so a space becomes %20 and so on.

This is a realistic example of a possible link with auto-fill:
http://yoursite/contact-us.html?textarea1=Test%20message&dropdown1=Item%20value

Do you confirm if it works for you?

Please Log in or Create an account to join the conversation.

More
19 Jul 2017 15:42 #14 by Eugenio Murgo
Replied by Eugenio Murgo on topic Load form with prefilled fields via link - how?
Hi, i've tryed to use query string to autofill form field. This solution does not work for me even if I'm using the latest version

For example: http://www.site.com/formpage.html?name=pippo to fill name field in form

Please Log in or Create an account to join the conversation.

More
27 Jul 2017 15:56 - 27 Jul 2017 15:59 #15 by gba
Hi!

I tried i. e.
<a href="index.php?textfield2=SchaltschrankbauerIn&textarea1=Anmerkungen&Itemid=195">
But this gets to be
<a href="http://www.stuetzner.at/index.php/ich-m%C3%B6chte-mich-bewerben/textarea1/Anmerkungen/textfield2/SchaltschrankbauerIn">
and this does not work:
It opens the form but without fields being prefilled.

You can try the "jetzt bewerben >" link here:
http://www.stuetzner.at/index.php/handwerk/46-elektriker/186-schaltschrankbauerin

Do you have any idea, how to get the new feature working?

Kind regards,
Gerald

Please Log in or Create an account to join the conversation.

More
27 Jul 2017 17:33 - 27 Jul 2017 17:34 #16 by Demis [Fox-Labs]
Replied by Demis [Fox-Labs] on topic Load form with prefilled fields via link - how?
Gerald,
you are right. I see that the Joomla SEF router changes the destination URL.

To workaround this problem, when you build the destination URL, simply skip the initial part (http, domain and index.php).
Create the link starting with the question mark "?" as follows:

<a href=" ?option=com_foxcontact&view=foxcontact&Itemid=195&textfield2=SchaltschrankbauerIn&textarea1=Anmerkungen ">

If you click the link above, it seems working as expected.
Please confirm whether it works for you.

Please Log in or Create an account to join the conversation.

More
27 Jul 2017 18:20 - 27 Jul 2017 18:34 #17 by gba
Hi!

Thank you for that workaround.
Works somehow ... but unfortunately the search engine friendly URL is not working this way.
We do need that.
Could you, please, fix that ASAP?
Thank you very much in advance!

Kind regards,
Gerald

EDIT: Maybe you want to think of a simple plugin for usage in content, and which takes care of proper Joomla! routing. It could look like
{foxcontactpagelink text = [some HTML code] | Itemid = [ID of the page's menu item] | [parameter array: parameter1=value1 | parameter2 = value 2 | ...]}

Please Log in or Create an account to join the conversation.

More
27 Jul 2017 18:46 - 27 Jul 2017 18:46 #18 by Demis [Fox-Labs]
Replied by Demis [Fox-Labs] on topic Load form with prefilled fields via link - how?
Yes, I confirm that the trick is intended to prevent Joomla from creating a SEF URL, because as you have reported, Fox Contact is currently unable to obtain those values from a SEF URL.

We will fix this in the next minor version (3.8) as we need to modify our router anyway, because of the new router architecture that Joomla is going to introduce in 3.8 series.

The time frame for this is depends on the Joomla roadmap. Currently, Joomla 3.8 is planned for September, 2017, as well as Fox Contact 3.8.

Please Log in or Create an account to join the conversation.