Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Prequalify for 2 separate calculators 07.07.2012 23:22

I have two calculators built and I'm trying to figure out a way to have a set of pre-qualifying questions, and depending upon the answers, would send the user to one calculator or the other. Do you have any ideas on how I can do that?

Re: Prequalify for 2 separate calculators 09.07.2012 17:46

Hello,
you could build that structure in some different ways, depending on your coding level you could do:

Place each calculator inside a different article, and create a new article with a third calculator containing the questions. The solution to be shown for this calculator is the link to follow to the corresponding calculator.

Or

Place the three calculators inside the same page, placing your two calculators inside hidden divs. The question calculator could hide/show each of the divs depending on the answers using javascript events section.

Hope this helps
Moonsoft Team
www.moonsoft.es

Re: Prequalify for 2 separate calculators 10.07.2012 22:22

The first option did the trick. I'd really like for them to be able to go directly into the new article without having to click a link. It sounds like the second option would make that happen? Still a rookie, not sure how the javascripts work.

Re: Prequalify for 2 separate calculators 11.07.2012 09:15

Hello,
yes, the second option uses a different approach, we see it as a single article with sections showing/hiding dynamically. This would avoid using links to show the calculators, but it would require some more complex coding indeed. The javascript section starts execution when the page is ready, so you should add new events to the elements needed at the questions form in order to hide/show the calculators below, that you should have placed inside a block (each one inside it's own div, for example), in order to change the display of the block when required:
display (none/block)

You will find an example at download section called

Hide/Show form fields depending on select combo box

that could show you how the code should look like, hope this helps.
If you want us to code this first calculator for you, please note you can also book the custom calculator service.
Moonsoft Team
www.moonsoft.es

Re: Prequalify for 2 separate calculators 22.07.2012 17:54

I ended up using the first option and it works fine for what I need. Now I want to take the field entries from one calculator and pre-fill them into corresponding fields in the next calculator. Is this possible? Any suggestions?

Re: Prequalify for 2 separate calculators 23.07.2012 10:59

Hello,

By now, there´s a way you can get fields from other calculator without changing code in PHP source. We could use cookies.

In first calculator add cookies at 'fields and code' in code section like this:

setcookie('NAME_TO_GET_IN_NEXT_CALC', $FIELD);

This makes the calculator set the cookies when user press 'Calculate' button.

In second calculator we need to get the cookie value. If you use Joomla 1.6+ you can do it with mootools. Just type in Javascript events something like this :

getCBFormValue('ID_OF_THE_FIELD').set('value',Cookie.read('NAME_TO_GET_IN_NEXT_CALC'));

This example is for an input type text. Maybe you should change javascript event in second calculator to set values to textareas, select, multiple input,...

Hope this helps. Regards,
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback