Hello @supersvetodiod
I’m sorry, but I don’t understand your description. Who are “example1”, “example2”, and “example3” for you?
Best regards.
I need to calculate three values.
Depending on what we select in the drop-down list. So there is a choice in the drop-down list: “Amperage”, “Voltage” and “Resistance”.
In order to calculate “Amperage” I have to enter data in fields 2 and 3.
In order to calculate “Voltage” I have to enter data in fields 2 and 40.
In order to calculate the “Resistance” I have to enter the data in fields 2 and 3.
The functions solve these problems.
But in the “Results” field, you can somehow implement it so that, depending on what value I calculate, information appears in the field header that I have now calculated “Current strength” or “Voltage” or “Resistance”.
https://disk.yandex.com/i/whNMk1x_ZSaFgw
Hello @supersvetodiod
In this case, you should insert three separate calculated fields for Amperage, Voltage, and Resistance with their corresponding equations and configure them as dependent on the DropDown field. Only the fields associated with the selected choice would be visible.
Learn more about dependencies by reading the following blog post:
https://cff.dwbooster.com/blog/2020/03/01/dependencies
Best regards.
I have set this up, but it is when the calculation takes place, in the calculation header itself, that I need a caption to be displayed, depending on the calculation, that we calculated “Current strength, or “Resistance”. So far, I have only achieved the ability to display this in text mode. But it is precisely above the “results” field that there is a heading. It is static.
(function(){
var result = ”;
if( AND(fieldname2, fieldname40) ){
result = fieldname2/fieldname40;
jQuery(‘.text-here1’).html(‘Voltage drop on all LEDs – ‘+result+’ V‘);
} else if( AND(fieldname2, fieldname3) ) {
result =fieldname2/fieldname3;
jQuery(‘.text-here2’).html(‘Voltage drop on all LEDs – ‘+result+’ Ohms‘);
}
else if( AND(fieldname40, fieldname3) ) {
result =fieldname40*fieldname3;
jQuery(‘.text-here3’).html(‘Voltage drop on all LEDs – ‘+result+’ A‘);
}
return result;
})()
Hello @supersvetodiod
You can enter a span tag in the field’s label:
<span class="text-here"></span>
And then, as part of the equation, you can include the pieces of code:
jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' V');
jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' Ohms');
and
jQuery(.text-here').html('Voltage drop on all LEDs – '+result+' A');
In the corresponding blocks.
Best regards.