Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate input disabled?

I would like simulate input disabled. I would like don't have change value in input, but this value should be send with POST with FORM.

<input class="dis" type="text" disabled="disabled" value="111">
<input class="no" type="text">
<input class="dis" type="text" disabled="disabled" value="333">

​ http://jsfiddle.net/hC4WP/

I can use also CSS and jQuery, but how?

like image 216
Ron Forzestering Avatar asked Nov 29 '22 02:11

Ron Forzestering


1 Answers

Use the readonly attribute instead of disabled.

However, this will not result in the field being grayed out. To achieve this, use the following CSS:

input[readonly] { color: #aaa; }

(you might have to change the color a bit to look more like the original disabled color)

like image 140
ThiefMaster Avatar answered Dec 13 '22 05:12

ThiefMaster