Forum


Calc Builder Support

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

Dynamic Results 26.04.2012 06:13

Hi,

Is it possible to remove the calculate button and have the exit layout variables visible and populate and update instantaneously (1 - 2 seconds) when a user enters a value into the form?

I'd like to skip the user having to click the calculate button to see the results and have the results display in real time as they are manipulating the form.

Regards.

Re: Dynamic Results 26.04.2012 10:23

Hi,
yes, that function can be achieved adding js events to your form. To find out how should be done, please download the two last example calculators from your download area. You will find an example of how to lauch calculator on change event of the fields, or on key up event with a second of delay. That code is the same you should use for your form, as it applies to all text input fields you have defined.

Once you have this working, to hide calculate button you can edit css file

joomla/modules/mod_calcbuilder/assets/css/default.css

and add
display:none;

to
.cb_button{

class.

Hope this helps, regards
Moonsoft Team
www.moonsoft.es

Re: Dynamic Results 27.04.2012 05:48

Hi,

Thanks for your answer - it helped, however I have not been able to determine how to keep the exit layout visible on the front end. I want the values to update in real time without the table appearing and disappearing each time to repopulate. I've managed to keep it from doing this once it's fired the initial time (by un-commenting the window.addevent reveal code and changing the transition to none) but I would like it to remain open always. How is this possible?

Here are a few other items I am struggling with and hoping you can direct me:
1) I've attempted to use numerous javascript codes to make it so my input fields only accept numbers (and in some cases decimal points), however nothing seems to be working. How do I accomplish this? It's alot more user friendly to not allow someone to type certain characters in than to keep receiving popup warning messages.
2)I have used the rounding method described in other posts, and referenced by the demo, however I can not get my results to round to two degits after the decimal place and if the number does end in 0 (ex: $10.50 - it appears as $10.5) I need the 0 to show.
3)In an effort to end the warning popups and because none of my efforts to stop users from typing in certain characters have not worked I've ended up setting my decimal allowance number really high with the intent to have the input field auto round when atleast calculating - however the result numbers appear to be factoring in the long decimal digits. How can an input field be automatically rounded? (This will likely be determined by an answer to number 2).

Sorry to bombard you with questions, but this is a great product and I think exactly what I need providing I can get these questions out of the way.

Regards

Re: Dynamic Results 27.04.2012 10:26

Hello,

We try to resolve all your questions (Please do a backup before):

Thanks for your answer - it helped, however I have not been able to determine how to keep the exit layout visible on the front end. I want the values to update in real time without the table appearing and disappearing each time to repopulate. I've managed to keep it from doing this once it's fired the initial time (by un-commenting the window.addevent reveal code and changing the transition to none) but I would like it to remain open always. How is this possible?


To remain always open you sould go to JOOMLA/modules/mod_calcbuilder/tmpl/user.php and search

function submitAjaxForm(){

in line 53

In this function comment (use /* */ to comment all block, including start and end of php code) this lines:

- From 57 to 66 :
$('cb_result').dissolve();

$('cb_tools').fade('hide');


$('cb_tools_excel').fade('hide');


$('cb_tools_email').fade('hide');

- From 93 to 102 :

$('cb_tools').fade('in');


$('cb_tools_excel').fade('in');


$('cb_tools_email').fade('in');

$('cb_result').reveal();
- From 113 to 122 :

$('cb_tools').fade('in');


$('cb_tools_excel').fade('in');


$('cb_tools_email').fade('in');

$('cb_result').reveal();



Here are a few other items I am struggling with and hoping you can direct me:
1) I've attempted to use numerous javascript codes to make it so my input fields only accept numbers (and in some cases decimal points), however nothing seems to be working. How do I accomplish this? It's alot more user friendly to not allow someone to type certain characters in than to keep receiving popup warning messages.


To avoid any validation in numbers you can go to JOOMLA/modules/mod_calcbuilder/helper.php and go to line 261. Replace:

type==0){ ?>
regex=/^(\d|-)?(\d|)*\?\d*$/;
if (!regex.test(value)) return false;
?php }

with

?php

and not configure dcimal or imits in backend for this input fields.



2)I have used the rounding method described in other posts, and referenced by the demo, however I can not get my results to round to two degits after the decimal place and if the number does end in 0 (ex: $10.50 - it appears as $10.5) I need the 0 to show.


We think you are using number format. According to PHP documentation if you write:

number_format('77.2',2) ->> The output is 77.20

You can check PHP docs at http://php.net/manual/es/function.number-format.php


3)In an effort to end the warning popups and because none of my efforts to stop users from typing in certain characters have not worked I've ended up setting my decimal allowance number really high with the intent to have the input field auto round when atleast calculating - however the result numbers appear to be factoring in the long decimal digits. How can an input field be automatically rounded? (This will likely be determined by an answer to number 2).


To automatically round input fields in web page you probably need to write some javascript code or use a library mask. We´re sorry to tell you that Calcbuilder doesn´t include any javascript library or code to do what you want.


Hope this helps,

Edited by MSTeam - 27.04.2012 10:27
Moonsoft Team
www.moonsoft.es

Re: Dynamic Results 30.04.2012 19:39

Hi,

Thank you for the information. I've managed to figure out the majority of my questions with the help of your great responses. I am still trying to figure out how to have the exit layout always visible (this includes when you first land on the calculator page on the front end of the site).

I have commented out the lines you indicated however it seems to have made no difference. I was already capable of keeping the submitted layout open after the first initial input field is clicked - but I want it open when you first get to the page before clicking into any fields.

Please indicate what I can do to make this possible.

Again, great work on the program.

Regards

Re: Dynamic Results 01.05.2012 13:35

Hi,
at the time you enter the module view you can launch the calculation (as if calculate button was pressed). Please go to javascript section, and place this line as the last one


strFun='submitAjaxForm'+seed+'_()'; eval(strFun);


Please note you must already have a line like this


seed=$('cb_layout_wrapper').get......

placed before, this is already included at the dynamic results examples.
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