HTML form readonly SELECT tag/input

前端 未结 30 2362
陌清茗
陌清茗 2020-11-22 08:28

According to HTML specs, the select tag in HTML doesn\'t have a readonly attribute, only a disabled attribute. So if you want to keep

30条回答
  •  孤街浪徒
    2020-11-22 09:06

    If you are using jquery validate, you can do the following below, I used the disabled attribute without a problem:

    $(function(){
        $('#myform').validate({
            submitHandler:function(form){
                $('select').removeAttr('disabled');
                form.submit();
            }
        });
    });
    

提交回复
热议问题