Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Readonly property not working

Tags:

jquery

"readonly" property not working. Please check my code below http://jsfiddle.net/KZArL/

Even after setting readonly still i can change value...I am using the below code

$('select').prop('readonly','readonly');

If i disable post won't carry disabled value...

like image 957
Reddy Avatar asked Jan 20 '23 03:01

Reddy


1 Answers

AFAIK, you cannot make a select read only, what you need to do is disable it:

$('select').prop('disabled', true);

Bare in mind that disabled form fields are not submitted with the form.

like image 193
Dunhamzzz Avatar answered Feb 06 '23 10:02

Dunhamzzz