How to continue form submission after an AJAX call?

后端 未结 4 377
陌清茗
陌清茗 2021-01-14 11:08

I want to validate user entries on a WordPress post upon hitting the submit button, display an error message is there are problems, and submit the form if everything is OK.

4条回答
  •  不思量自难忘°
    2021-01-14 11:58

    Wordpress has its own mechanism to process Ajax requests, using wp-admin/wp-ajax.php. This allows you to run arbitrary code on either side of the Ajax boundary without having to write the back and forth status-checking code and all that. Set up your callbacks and go....

提交回复
热议问题