Our logo Kybercode
Home
Archive
Articles
Shared
Bits
About
Contact
Home
Archive Articles Shared Bits

About
Contact
RSS
Topics Authors Privacy Policy
Search
HTML Web Dev
Cooper Gidge on May 4, 2025.

What's the difference between readonly and disabled in form controls? I found myself asking this question when implementing a very specific feature.

I'm making a form to send data, but I also want to include some generic information that the user doesn't need to enter. So I added another <input> element and gave it a visually-hidden class. But then I was faced with a question...do I set it to disabled or readonly?

After consulting this thread, I settled on readonly because it appears that the value of disabled inputs won't be sent when the form is submitted.

Comments

There are no comments yet. Be the first to post one!

Leave a Comment

Thank you for posting a comment! It will be reviewed and if it passes our checks, it'll be published.

Replying to

This will be publicly displayed with your comment.

Contribute to the conversation! Markdown supported.

Keep Reading

Previous So overflow-wrap: break-word and CSS Grid don't work well together.

By Cooper Gidge on May 28, 2025.

Next Safari is a Difficult Browser to Work With

By Cooper Gidge on Mar 31, 2025.

Browse More
The AI Bubble Burst, Just Not In The Way I Was Expecting

By Cooper Gidge on Jan 28, 2025.

Why I Don't Use JavaScript Frameworks

By Cooper Gidge on Jan 19, 2025.

How To Automate Open Graph Images With Eleventy

By Cooper Gidge on Dec 5, 2024.

Featured
Logo Kybercode

All things about software and website development.

RSS
Resources
Home Archive Articles Shared Bits Topics
About
About Contact
Copyright © 2025 Kybercode
Privacy Policy
Home
Archive
Articles
Shared
Bits