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

input Fields only showing numbers

1474261407
Falcon
Pro
Sheet Author
For example: <input type="text" name="attr_weapon" value="KE-1500"/> <input type="text" name="attr_show_weapon" value="@{weapon}" This will ONLY show 1500 in the field and ignore the first part.  I have seen this throughout when using an attr trait.   Is there anyway around this so that the actual description is shown instead of just numbers?
The closing of the last tag is dropped in your example, but I imagine you have a disabled="true" in there. That makes the field calculate and it sees the dash as a minus sign. If you just want to repeat the value, use the same attr_ name and use readonly="true" , like this:         <input type="text" name="attr_weapon" value="KE-1500"/>         <input type="text" name="attr_weapon" readonly="true" />
1474332815
Falcon
Pro
Sheet Author
So that's what readonly does.  But does it change my CSS code?  Do I need to make a new one for CSS?
I don't think so. In the test game where I tested the above, the readonly input field looked exactly like the original input field.
1474351290

Edited 1474351341
vÍnce
Pro
Sheet Author
You can also use <span name="attr_weapon"></span> to display read-only data.  Might come in handy if you don't want to style or show an input box.
1474351737
Falcon
Pro
Sheet Author
awesome - will try both
1474352078
Falcon
Pro
Sheet Author
By the way - it does require a new CSS code.  input[disabled] {     background-color: #eaffef;     border-color: #ddd;     cursor: not-allowed; -moz-appearance: textfield; }  input[read-only] {     background-color: #eaffef;     border-color: #ddd;     cursor: not-allowed; -moz-appearance: textfield; }
Sorry I misunderstood your CSS question. Yes, if you want to match other sheet styling you will need to add CSS for readonly inputs as you found, but the readonly attribute does not require CSS to work.