Here is an example jade input:
The class variable is undefined
input.class(name="class", type="textfield", value="#{locals.class}")
This shows up as a form with undefined already set as the value. That's not what I want, if it's undefined then no text should appear.
I can also do this:
-if (locals.class) {
input.class(name="class", type="textfield", value="#{locals.class}")
- } else {
input.class(name="class", type="textfield", value="")
- }
But it seems fairly terrible/unusable if I have to do this for every input in every form across the app.
Is there anything I can do about this?
Simple fix, you just have to have to remove the quotes and braces and it will print an empty string
input.class(name="class", type="textfield", value=locals.class)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With