Forums

pre selected Dropdown value depending from the previous page

BeamerStation 19 Oct, 2012
Hi,
first i have to tell, that i like the chronoform very much. It is a very great tool for me.

I have installed the chronoform v4 on my page. My customers can select the product they want in a dropdown list and send me their name, adress and things like that. The data will be transfered perfekt to my cms system and in my email.
Now, here is my question, i did not finde a solution in the forum.

For every product in the dropdown i have a single page on my joomlawebsite, where you can see the details. is it possible to put a link to the form on these detail-webpage which will load the form and do a pre selection in the dropdown list?
It would be a little bit easier for my customers. They have a look on the details page, go to the Button i will create which will lead them to the form, and there is allready the last product in the dropdownlist preselected.
How can i get this?

Thanks for your help.
GreyHead 20 Oct, 2012
Hi BeamerStation,

You can add a product ID or product name to the link in the product page; or you could use a mini-form embedded in the article and automatically pick up the product ID if it is available. There's a FAQ here on getting the current page title or url if that helps.

Bob
BeamerStation 22 Oct, 2012
Thanks for your help.

You can add a product ID or product name to the link in the product page;


How does this work? How has the link to look like if i want to add the fieldname and the diffrent option values for every product page?

I think the form is to big to do it on a module position.
GreyHead 22 Oct, 2012
Hi BeamerStation ,

It's hard to give a specific solution without a lot more detail. It depends on what information is available on the product pages and where and how the product information is saved.

The minimum would be to add &pid=999 to the form URL where 999 is the current product id. Then you could use the value of pid (as {pid} or $form->data['pid'] depending on where you want to use it) to add to your form or to look up more product information.

Bob
BeamerStation 22 Oct, 2012
Hi Greyhead,

So ok, here are the details.🙂
I got this "product page". http://berlin.beamerstation.de/2200-beamer-in-berlin.html in my joomla installation. You will finde a link "Zum Online-Bestellen für den Beamerverleih" there, which will lead you to the form i build. http://berlin.beamerstation.de/online-bestellen.html

In the form you can find "Beamer auswählen:" and i want to modify the link "Zum Online-Bestellen für den Beamerverleih" in that way,that it will be selected "2200 Lumen Beamer" in the Drop-Down List for "Beamer auswählen" if i klick the link.
Same way with the other pages for 2500 Lumen Beamer, 3500 Lumen Beamer and so one.

The minimum would be to add &pid=999 to the form URL where 999 is the current product id. Then you could use the value of pid (as {pid} or $form->data['pid'] depending on where you want to use it) to add to your form or to look up more product information.



I think this is maybe the same thing, but i dont know how to use this possibility exactly. where can i store the pid? and how can this be working with the different options in the dropdownmenu?

i tried this berlin.beamerstation.de/online-bestellen.html&pid=2200 and always got a not found. in the formfield configuration i did the dynamic data to yes, and the value key to pid. But it did not work.
Maybe i just dont know how to use it exactly?
GreyHead 22 Oct, 2012
Hi BeamerStation,

First the link needs to include some kind of parameter, as the Beamer Auswahlen dropdown has the name cf_642 it's simplest to use that.

But the Beamer Auswahlen dropdown has no visible options set to I can't say what the parameter value would be.

Bob
BeamerStation 22 Oct, 2012
Hi GreyHead, thanks, your alway very fast.🙂

i still did not get the way, how this link has to look like. For example: <!-- w --><a class="postlink" href="http://www.domain.com/form&dropdownid=cf_642&dropdownoption=2200">www.domain.com/form&dropdownid=cf_642&d ... ption=2200</a><!-- w --> Lumen Beamer ?
So if i understand the logik of the link i think i can get it. Maybe i have to rename something because of spaces or special charakters in the name, but that is no problem for me.
GreyHead 22 Oct, 2012
Hi BeamerStation,

What is the options list for the Beamer Auswahlen drop-down? Or where is it supposed to come from?

Bob
BeamerStation 22 Oct, 2012
Hi Bob,
the option list is this at the moment.

kein Beamer=kein Beamer
2100 Lumen Beamer=2100 Lumen Beamer
2200 Lumen Beamer=2200 Lumen Beamer
2500 Lumen Beamer=2500 Lumen Beamer
3500 Lumen Beamer=3500 Lumen Beamer
4700 Lumen Beamer=4700 Lumen Beamer
4000 Lumen HD Beamer=4000 Lumen HD
5500 Lumen Beamer=5500 Lumen

These are also the names for the vtiger custome fields with will be filled in with the curl function. But i think i can change them, because the spaces maybe will be dufficult.
Thank you.
GreyHead 23 Oct, 2012
Hi BeamerStation,

Hmm . . . why are those options not showing in the form?

it's tricky to match up values from a URL with option values that include spaces. You can do it by URLencoding and URL decoding; it would be easier if the values were like 2100LumenBeamer or a product ID like 2100LB.

Bob
BeamerStation 23 Oct, 2012
Hi Bob,
i am sure that without spaces will be better. But at the moment i tested it also with only 2200 as namevalue.
I think it would be the best if you can give me a hint with the link. How has the Link to look like, you can use dummies for that, so i will try it and change the spaces out of the values, and things like that. It will also help other people best if they can see, how the link is to use. Link looks like domain/form&fieldID=xy&optionvalue=yz Something like that?
GreyHead 23 Oct, 2012
Hi BeamerStation,

The basic link you can copy from the FrontEnd View link in the ChronoForms Forms Manager. It will look like:
http://berlin.beamerstation.de/index.php?option=com_chronoforms&chronoform=Berlinbestellformular&cf_642=2200+Lumen+Beamer


However, this won't work because (a) there is a problem with spaces and (b) there are still no options for the drop-down you want to set.
Bob
BeamerStation 24 Oct, 2012
Thnak you Bob,
this helped me a lot.
I did not see the link because of the rewrite rule in Joomla.🙂 And i did not know the structure, because i am not so deep in to coding.🙂
Nevertheless, with your link i could mofify the link and it worked in 3 of 4 positions very well.
I got the right Mail, the customer got the right mail and the vtiger got the right data. Only in the frontshowing of the form is the field "Beamer auswählen" with empty options to see.

Hier is the link http://berlin.beamerstation.de/index.php?option=com_chronoforms&chronoform=Berlinbestellformular-copy&cf_642=2200 Lumen Beamer

I used the %20 for the spaces in the link

This give me some new possibilities now, i have to think about.
Is it posssible to dont show the field Beamer auswählen in the form if someone get over the link to the form but if he goes to the form directly then the field will be showen?

I will also test it with changing the optionvalues without spaces and see what will happen.

could it be helpfull do lern more about the dynamic data possibilities in the chronoform?

and i got another totaly diffrent question. is it possible to integrate the chronoform in an virtuemart shopping system? Because i am a rentalservice i have to ask my customers Date and Time for beginn and End of Renting. Everything els will be just like in a shop. If i can put the Date and Time part with chronoforms in the virtuemartsystem and both of the data send to my vtiger.
BeamerStation 24 Oct, 2012
Thank you so much,
i found my solution for the next time.

I changed the values and use underlines instead of spaces now, and it will work very well.

I have to change a lot names in the vtiger now, but that s no problem.
I can get much more functunality for my customers in that way.
GreyHead 24 Oct, 2012
Hi BeamerStation,

Great, good to hear you have it working.

The VirtueMart question is not simple :-( a year or so ago there was a user here who I think got a form working with VirtueMart but the table structure they use is complex and it's complex task.

Bob
This topic is locked and no more replies can be posted.