Please help me. I use Codeigniter.
In VIEW i have
\'
A disabled
element does not send its value in the POST
.
If you want data to be passed but prevent users from editing the field, use readonly
instead.
edit: Apparently, this isn't an option for <select>
boxes. See HTML form readonly SELECT tag/input for a solution.
http://kreotekdev.wordpress.com/2007/11/08/disabled-vs-readonly-form-fields/
Would like to point out that the answer above is the best solution so far.
$('select option:not(:selected)').each(function(){ $(this).attr('disabled', 'disabled'); });
For the reason that, even when it's still disabled, the value still pass to the database without an error.