CalcBuilder Forum

Helping to create a calculator

Usuario moon_1299 2013-11-14 13:50:24

Hi!

Help to make a printing calculator:

http://lab01print.com/calc.html

Moonsoft support 2013-11-14 15:03:36

Hi,
in order to create a calculator like your example page, you will need to follow these steps:

- Create input fields. Create your input texts, option lists and checkbox/radioboxes using the types available.
- Place them at the input form. Using the '1 column layout' button will do it for you.
- Place your calculations at the code section. Here the calculations to be done are very specific for your case, you will need something like:

$myresult= $input1+$input2;

or

$myresult= (($input1*$input2)/$input3+35)*0.15;

...etc

- Configure your output. Print there any content you need to show, along with your calculated results (##myresult##)


We suggest to follow the guide and the videos on this site to have an overview of the options available. You can also download working examples from your customer area to use them as template for your own calculators.


Hope this helps,regards

Usuario moon_1299 2013-11-15 12:01:02

Thank you very much for your answer!

But I can not figure out how to make the buttons, which are located on the top and when you click on that change the values ​​in the fields below (as is the link: http://lab01print.com/calc.html)?

Moonsoft support 2013-11-15 14:05:46

Hi,
you can include any html element at your form layout, so you can include buttons using bootstrap classes(replace for lower/greater than symbols, they are sttriped by the forum:


Small button



More information about different styles and sizes of the buttons here:

http://getbootstrap.com/2.3.2/base-css.html#buttons

If you want to add a behaviour to the buttons, you will also need to include some js code. First, identify each button with a different id at the layout:

First button
Second button


And then add the functions attached to each one when clicked. At the javascript events-executed on loaded page:

CB("#mybutton1").click(function(){

//your code here when button1 is clicked

});


CB("#mybutton2").click(function(){

//your code here when button2 is clicked

});


You can find the code to set a value at a field at the left panel 'set value to a field.


Hope this helps, regards

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
List Manager

Build different lists for your site

Buy now!