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 here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Hi, Is it possible to set an input as readonly when a checkbox is checked? I know that there is action button and onClick function but can we change attributes other than "name" and "value" ? Thanks
The way I would handle that is toggle between the input and a named span. So, if the checkbox is not checked, display the input <input type="text" name="attr_myinput" /> And if the checkbox is checked, then hide the input and display something like this: <span name="att_myinput"></span>
This is the way. Personally, I'd use a readonly input instead of a span, so the appearance changes very little (just gets the grey shading of readonly).