Form not submitting inside $.ajax success function

前端 未结 11 1571
被撕碎了的回忆
被撕碎了的回忆 2021-01-18 20:34

I\'m validating for duplicate names by using jquery+Ajax. Everything is working fine except that the form is not submitting once everything returns true

What

11条回答
  •  清酒与你
    2021-01-18 21:20

    instead of this.submit() write :

    document.yourFormName.method = "POST";
    document.yourFormName.action = "Relative_URL_to_Go_to";
    document.yourFormName.submit();
    

    or if you dont know the formName alternately u can use :

    document.forms[0].method = "POST";
    document.forms[0].action = "Relative_URL_to_Go_to";
    document.forms[0].submit();
    

提交回复
热议问题