Disabled attributes are not submitted with forms

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the web-development category.

Last Updated: 2024-04-24

I added a disabled HTML field for the seller country. I could see the chosen country in a disabled select box in the frontend. It looked legit...

However, I found the data was never submitted to the backend on form submission, leading to data consistency issues.

What I learned was that any input with the disabled attribute will not be submitted with the form!

Ideas to get around the limitation in my code-base: