Re: Combine Calc-Field with Select-Field and Number-Field?
Posted: Sun Apr 04, 2021 9:15 pm
Hello,
a new question about the Spice Tool.
I recreated the Forumar from your demo, it worked
Demo (https://test.nubuilder.cloud/ login: test psw: nutest)
But there has been a change in my calculation and I need a new code for it
It's no longer about pepper or salt, it's just about salt

I took the form code from the demo and adapted it.
It works, but I'm still not sure it's right.
I don't want there to be problems in the future.
Is the code so correct or is there a better one?
a new question about the Spice Tool.
I recreated the Forumar from your demo, it worked
Demo (https://test.nubuilder.cloud/ login: test psw: nutest)
But there has been a change in my calculation and I need a new code for it
It's no longer about pepper or salt, it's just about salt

I took the form code from the demo and adapted it.
It works, but I'm still not sure it's right.
I don't want there to be problems in the future.
Code: Select all
function myspices(){
var meat_weight=$('#1W12').val();
var spice_type = $('#1W11').val();
if (spice_type=='BBQ/Chili'){
spice_weight = meat_weight * 0.2;
$('#1W1M5').val(spice_weight).change();}
else if (spice_type=='Original') {
$('#1W1M5').val(0).change();}
else {
$('#1W1M5').val(0).change();
}
}
Is the code so correct or is there a better one?