Home > Article > Web Front-end > Ajax method to synchronously verify whether the order number exists
This article mainly introduces the method of ajax synchronous verification of the existence of the order number, involving the operation skills related to data interaction based on ajax. Friends in need can refer to it
The example of this article tells the ajax synchronization verification of the order number method exists. Share it with everyone for your reference, the details are as follows:
//保存前执行的方法,ajax同步调用后台验证包裹单号是否存在 function doBeforeSave(){ var packageCode=document.getElementById("packageCode").Value; var temp=false; if(packageCode!=""){ $.ajax({ url: "${ctx}/finance/packageManagement!parcelsWhetherExists.do", //接收页面 type: 'post', //POST方式发送数据 async: false, //ajax同步 data:{packageCode:packageCode}, success: function(result) { temp = eval(result.result); } }); } if(!temp){ alert("包裹单号已存在!"); toft.resetForm("addDataForm");//清空表单 toft.id("packageCode").focus(); } return temp; }
The above is what I compiled for everyone, I hope it will be helpful to everyone in the future.
Related articles:
Ajax gets the data and then displays it Implementation method on the page
Ajax setting async implementation method to verify whether the user name exists
The above is the detailed content of Ajax method to synchronously verify whether the order number exists. For more information, please follow other related articles on the PHP Chinese website!