Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 1 character in body
Source Link
HoldOffHunger
  • 21.3k
  • 11
  • 123
  • 147

There is no reason you can't simulate the disabled attribute using a combination of CSS and readonly:

Faux-Disabled: <input type="text" id="start-on" value="1" readonly=""readonly="1" style="background-color:#F6F6F6;"><br> Real-Disabled: <input type="text" readonly="" disabled="true" value="1"></input>

Note: This will not have the regular behavior of disabled in the <form>, which prevents the server from seeing the field. This is just in case you want to disable a field that doesn't matter server-side.

There is no reason you can't simulate the disabled attribute using a combination of CSS and readonly:

Faux-Disabled: <input type="text" id="start-on" value="1" readonly="" style="background-color:#F6F6F6;"><br> Real-Disabled: <input type="text" readonly="" disabled="true" value="1"></input>

Note: This will not have the regular behavior of disabled in the <form>, which prevents the server from seeing the field. This is just in case you want to disable a field that doesn't matter server-side.

There is no reason you can't simulate the disabled attribute using a combination of CSS and readonly:

Faux-Disabled: <input type="text" value="1" readonly="1" style="background-color:#F6F6F6;"><br> Real-Disabled: <input type="text" disabled="true" value="1"></input>

Note: This will not have the regular behavior of disabled in the <form>, which prevents the server from seeing the field. This is just in case you want to disable a field that doesn't matter server-side.

Source Link
HoldOffHunger
  • 21.3k
  • 11
  • 123
  • 147

There is no reason you can't simulate the disabled attribute using a combination of CSS and readonly:

Faux-Disabled: <input type="text" id="start-on" value="1" readonly="" style="background-color:#F6F6F6;"><br> Real-Disabled: <input type="text" readonly="" disabled="true" value="1"></input>

Note: This will not have the regular behavior of disabled in the <form>, which prevents the server from seeing the field. This is just in case you want to disable a field that doesn't matter server-side.