[Pas2js] fieldset (or other tag) change the disabled attribute
Michael Van Canneyt
michael at freepascal.org
Tue Sep 13 16:33:57 CEST 2022
On Tue, 13 Sep 2022, Luca Olivetti wrote:
> the bulma documentation says that you can disable a form partially or totally
> by enclosing the fields to be disabled in a
> <fieldset disabled></fieldset>
> I could find no way to change the disabled using the classes in htmlwidgets,
> I couldn't find a TJSHTMLFieldSet and TJSHTMLElement has no disabled
You can access ALL attributes using the properties property of TJSObject.
So if 'El' is your object instance then you can set disabled:
it is also the default property so the following also works:
> I cast it to a TJSHTMLButtonElement and it works, but, meh, I don't like it.
> I added a "disabled" field to TJSHTMLElement (and removed it from all other
> descendant) and it also works.
> I also don't like to have some elements using htmlwidgets and other elements
> using TJS*.
> Is there a better, proper, way?
The correct way is to introduce TJSHTMLFieldSet and declare the disabled
property. As long as that class does not exist, see above.
More information about the Pas2js