Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Bug with spans on disabled inputs

1493324541

Edited 1493324678
Alex R.
Sheet Author
If you have a span set to display the value of an input, and that input is disabled, having a value of another attribute, the span will display the math, rather than the actual value.   <input type="number" name="attr_test"/> <!--Normal input-->     <input type="number" name="attr_this_is_test" disabled="true" value="@{test}"/> <!--Disabled input with expected value-->     <span name="attr_this_is_test"></span> <!--Span with the value "@{test}"-->     <span name="attr_test"></span> <!--Span with expected value--> Is there a workaround for this?
1493326167

Edited 1493326233
Lithl
Pro
Sheet Author
API Scripter
The value of @{this_is_test} is in fact "@{test}", so the span is reporting that accurately. The attribute reference is getting resolved by the system only because it's in a disabled input. You could try  adding disabled to the span, but I believe the code that collects autocalc fields only grabs disabled form elements, not all disabled elements. (After all, a disabled span doesn't make much sense.) If you want a calculated value and you want to regurgitate that value in a span, your best choice is to use readonly (instead of disabled), and set the value of the field with a sheet worker script.
I tried disabled on the span, but no luck. Thanks! I'll have to look into that workaround.