CalcBuilder Forum

How does field option "Inline Result" work?

User moon_1230 2013-08-30 15:45:33

Hi.

I'm am trying to figure out a way to make the form display the result to the user before clicking the submit button and sending the form results to me.

I noticed the field option "Inline result" but i can't figure out how it works? Does anybody have a description or an example I can see?

Or maybe you have another suggestion for me to make the form show the result befor e clicking a "send results"-button.

Btw. I tried the "Hide Calculate button and get results on change value of every field"-option in combination with the "Send form results to" but that does not work very well, because every time you click or change any value in the form, a new e-mail is sent...

Nikolaj.

Moonsoft support 2013-08-30 21:22:20

Hi,
the inline results are intended to show intermediate results inside the input form before the final 'calculate' button is pressed. Here the basic steps to have an inline result working on your calculator:

- Create a new field, named for ex: myintermediate . Type it as 'inline result'.
- Go to your input layout and insert the field same way you use for normal inputs ##myintermediate##
- Enter your calculator code and calculate this result as if it was a default result, for ex:


$myintermediate=5+3;
or
$myintermediate=5+$input1;

..etc

- Try your calculator, you will see the inline result refreshes when you edit your input form.


Hope this helps, regards

User moon_1230 2013-09-02 09:14:00

Thank you very much. It works perfectly.

Now I only have one more question. How do I make a radiobutton preselected?

Moonsoft support 2013-09-02 14:03:26

Hello,
place the value (not the name) of your preferred option as Default
value for that field. You should see the chosen option preselected when form is created.

Regards

User moon_1230 2013-09-03 09:26:52

Thank you. You are the best!
Just one last thing that is bugging me.
In my form i have some fields that the user fills to calculate an estimated price. Then i have put the inline Result field in the middle. And in the bottom the customer fills out name, address etc.
I just noticed that the Inline Result does not calculate the results when I set the customer "Name" field as a reguired field. I would like the Inline result to calculate regardless of the required fields are filled. Is it possible somehow to make the Inline result field ignore the required fields?
The required fields should only be prompted when the user clicks the send button.

Moonsoft support 2013-09-03 10:00:04

Hi,
the calculator doesn't know if your required fields are needed to calculate the intermediate results, that's why always launches validator before any calculation. If you only need validator to launch at the final step, you can try to introduce a tweak to the module code. At

\joomla\modules\mod_calcbuilder\tmpl\user.php

search about line 310:

function getDataInline........
if (validateForm



and introduce this change in order to cancel the validator

function getDataInline........
if(true||validateForm...


Hope this helps, regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!