Values of disabled inputs will not be submitted

前端 未结 7 2380

This is what I found by Firebug in Firefox.

Is it the same in other browsers?

If so, what\'s the reason for this?

7条回答
  •  生来不讨喜
    2020-11-22 05:53

    select controls are still clickable even on readonly attrib

    if you want to still disable the control but you want its value posted. You might consider creating a hidden field. with the same value as your control.

    then create a jquery, on select change

    $('#your_select_id').change(function () {
        $('#your_hidden_selectid').val($('#your_select_id').val());
    });
    

提交回复
热议问题