The method of Ajax synchronization to verify whether the order number exists


In this paper, an example is given to illustrate the method of Ajax synchronous verification of the existence of order number. To share with you for your reference, as follows:

//The method executed before saving. Ajax synchronously calls the background to verify whether the package number exists
function doBeforeSave(){
  var packageCode=document.getElementById("packageCode").Value;
  var temp=false;
     URL: "${CTX} / Finance / packagemanagement! Parcelswhetherexists. Do", // receive page
     Type: 'post', // send data by post
     Async: false, // Ajax synchronization
     success: function(result) {
      temp = eval(result.result);
   Alert ("package No. already exists! "";
   Toft. Resetform ("adddataform"); // clear the form"packageCode").focus();
  return temp;

I hope that this article will be helpful to the Ajax based programming.

Recommended Today

Swift advanced (XV) extension

The extension in swift is somewhat similar to the category in OC Extension can beenumeration、structural morphology、class、agreementAdd new features□ you can add methods, calculation attributes, subscripts, (convenient) initializers, nested types, protocols, etc What extensions can’t do:□ original functions cannot be overwritten□ you cannot add storage attributes or add attribute observers to existing attributes□ cannot add parent […]