Calc Builder Support

Calc Builder support
Public write access is disabled. Please login

Set default value 03.09.2014 20:26

How can I set default value into number input using another number input?

Re: Set default value 03.09.2014 20:34

in order to set field values dynamically you must use javascript section to capture the event of the first field changing and assign a new value to the destination field, this code should be placed at the first js tab of your calculator, replacing yourfirstfieldname and yoursecondfieldname with the right field names at your form:


var newvalue=CB("input[fldname=yourfirstfieldname]").val();



Hope this helps, regards
Moonsoft Team

Re: Set default value 16.11.2015 18:16

hi i want the same as above but from an inline field to a text field default value that can be changed by the user.

Re: Set default value 17.11.2015 10:52

that is more complex, as you can't capture the event of the inline result being changed, because it's done internally by the calculator script. As a workaround, you can use other field change event, wait sometime until the inline field has the new value and then use it. The structure would be:


var newvalue=CB("div[fldname=yourinlinefieldname]").html();


}, 3000);




with your calculator fields. You can create more sections with the same structure and other 'yourfirstfieldname' in order to attach it to more input fields.

This is not an optimal solution as you're waiting 3sg for the result, you must ensure this is enough for the calculator returning the proper value to the inline, you should increase this time if required.

Hope this helps, regards

Edited by MSTeam - 18.11.2015 18:54
Moonsoft Team
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