Modify posted input values on onbegin of ajax.beginform

前端 未结 4 1094
庸人自扰
庸人自扰 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:02

    There is another way to do that :

    function funBegin(jqXHR, settings) {
        // before POST - change whatever posted value you want and then 
      // serialize again your form supposedly identified here by form
    
            settings.data = form.serialize();
    
      // the advantage is when you arrive here, the form validators have already been executed
      // and you know you have valid values - so you can post
        }
    }
    

    For meaning of parameters, see [http://api.jquery.com/jquery.ajax/]

提交回复
热议问题