How to make the field disappear if the calculation turns out to be 0?
-
I am trying to create code that shows a field only on certain conditions after the field calculation is performed. For example if adding 2 fields before it results in less then a certain amount, then not to show the field.
I tried using document.queryselector but in the console it shows that my selector: ‘div.fieldname28_1’ is invalid because it is now div ‘div.(0)_1’ and it’s an invalid selector.
Here is my code in the field that is not working:
(function(){
function removeField(){
document.querySelector(‘div.fieldname28_1’).setAttribute(“style”, “display : none”);
}let p = CEIL(fieldname4 * 0);
if (fieldname4 == “” || fieldname4 == null) return “Please Enter Value in the <Approximate Lineal Ft>”;
else if(p <= 0) removeField();
else return p;
})();You can test it by going to the address where the plugin is installed. Enter 100 into the approximate linear feet. Select the Horizontal fence style. Select the 1×5.5×6 board size.
The page I need help with: [log in to see the link]
- The topic ‘How to make the field disappear if the calculation turns out to be 0?’ is closed to new replies.