Modify posted input values on onbegin of ajax.beginform

前端 未结 4 1076
庸人自扰
庸人自扰 2020-12-17 16:49

Can posted input values on onbegin of ajax.beginform be modified? I have to modify values of some of the input fields after the form is submitted.

4条回答
  •  有刺的猬
    2020-12-17 17:15

    I didn't feel like going outside of MVC's form submission handling so I solved this differently. Just bind to the form's submit button's click handler. Do your input value fiddling there. The onclick is fired before MVC's form serialization. The onclick also gets called even if the form is submitted by the user hitting enter.

提交回复
热议问题