How to wait for ajax validation to complete before submitting a form?

前端 未结 7 866
悲哀的现实
悲哀的现实 2020-12-20 23:00

Having a problem where the form submits before the validateUsername function has a chance to complete the username check on the server-side.

How do I submit the form

7条回答
  •  抹茶落季
    2020-12-20 23:21

    Why dont you just use $('#yourFormId').submit(); after you have received a result from your ajax backend?

提交回复
热议问题