submit disabled fields

后端 未结 8 1557
无人及你
无人及你 2020-12-03 04:34

I know the defined behavior for web forms is to not submit disabled fields... but that\'s not the definition I want. I want to use ajax to post the form and I want it to ge

相关标签:
8条回答
  • 2020-12-03 05:17

    Why not simply enable all the disabled input fields right before the submission using .removeAttr() and .submit() .

    $('#my_form').submit(function(){
        $("#my_form :disabled").removeAttr('disabled');
    });
    
    0 讨论(0)
  • 2020-12-03 05:17

    You can disable the inputs & before submitting the form you can re-enable them so the form will include them when posting to the server side

    0 讨论(0)
提交回复
热议问题