Forum
Calc Builder Support
Calc Builder supportForums
No se permite escribir sin estar logado. Por favor, login
Conditional Output 19.09.2012 12:32
I have created a couple of calculators for a site but my client would like to output a text line rather than the normal output when one of the results is negative.
I had a quick look at the 'Javascript events' but I am not sure if this is the area where I should be looking.
I see that in the guide there is a 'Ship costs' calculation that used Java but I can't find it to download and look at.
Thank you for a great component.
I had a quick look at the 'Javascript events' but I am not sure if this is the area where I should be looking.
I see that in the guide there is a 'Ship costs' calculation that used Java but I can't find it to download and look at.
Thank you for a great component.
Re: Conditional Output 19.09.2012 15:28
Hello,
in fact, you don't need to add javascript code for that. You can create conditional output using the default code section where you have placed your calculations. Once you have finished with the math (and before making number formatting, if any), you can handle your variable (for ex, $result), using the conditional, this way:
if(0>$result){
$result="This is the new output";
}
Hope this helps, regards
Edited by MSTeam - 19.09.2012 15:29
Moonsoft Team
www.moonsoft.es
in fact, you don't need to add javascript code for that. You can create conditional output using the default code section where you have placed your calculations. Once you have finished with the math (and before making number formatting, if any), you can handle your variable (for ex, $result), using the conditional, this way:
if(0>$result){
$result="This is the new output";
}
Hope this helps, regards
Edited by MSTeam - 19.09.2012 15:29
Moonsoft Team
www.moonsoft.es