Hi, I have the code (below) on my page, the default value for flour2 is zero. Is it possible (in wappler w/o using javascript) to automatically have form1.flour2.value reset back to zero when it is not shown?
Hi Paul, happy holidays to you, your friends and your family!!! Thanks for continuing to help me BTW.
I think I might have figured this out. Not tested yet but I have a good feeling. The problem is on my calculator if someone adds a value to any flour beyond the first one and then drops the number of flours to mix below that number the flour field is hidden and that number is stuck in the form and used in calculations. It is a big problem but I think the code below will fix. I fire the function “myStripFunction()” on a static event any time the number of flours to mix changes. If this works I will be amazed. Wish me luck!!!
function myStripFunction() {
if (form1.flourstomix.value < 10) {
(form1.flour10.value = 0);
}
if (form1.flourstomix.value < 9) {
(form1.flour9.value = 0);
}
if (form1.flourstomix.value < 8) {
(form1.flour8.value = 0);
}
if (form1.flourstomix.value < 7) {
(form1.flour7.value = 0);
}
if (form1.flourstomix.value < 6) {
(form1.flour6.value = 0);
}
if (form1.flourstomix.value < 5) {
(form1.flour5.value = 0);
}
if (form1.flourstomix.value < 4) {
(form1.flour4.value = 0);
}
if (form1.flourstomix.value < 3) {
(form1.flour3.value = 0);
}
if (form1.flourstomix.value < 2) {
(form1.flour2.value = 0);
}
}
</script>