Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    I wouldn't recommend this, it's only changing the visual appearance of the form and (as you also pointed out) you are still able to change field values and even submit the form only by keyboard navigation. From the accessibility perspective it's also not very good. People with screen readers won't see this form as disabled as it's semantically not disabled.
    – acme
    Commented Mar 8, 2021 at 14:10
  • I like this best. It does not have anything finicky about it. If you use disable - you stand chance of having the form fields data not being saved. If you use readonly - it is also buggy and does not work properly with drop lists. And this method also works on both 'form' and 'fieldset' which is more elegant and concise - rendering the complete form unchangeable. As well - with the CSS you have the choice to display the now unusable sections in the way that suits your interface design and style and visual cues best.
    – TV-C-1-5
    Commented Feb 24, 2022 at 3:47