disabled field is not passed through - workaround needed

后端 未结 7 513
夕颜
夕颜 2020-12-10 03:29

I have a form with which I want to update a MyModel object. On the model there is a unique_together constraint, fieldA together with fieldB. In the form in the clean method

7条回答
  •  天命终不由人
    2020-12-10 04:05

    I used jQuery to solve the problem by removing disabled from all inputs before submitting.

    $('#my_form').submit(function(){
        $("#my_form :disabled").removeAttr('disabled');
    });
    

    Used answer from another SO answer

提交回复
热议问题