DWZ Framework Ajax no-refresh form submission process is:
1. Ajax forms submitted to the server
2. The server returns a fixed-format JSON structure
3. JS will function according to the JSON data to do the corresponding processing
Attention:
The default Ajax form submission for the DWZ framework is to return JSON data that tells the client whether the operation was successful, the prompt for success or failure, and how to handle it successfully (refresh a navtab or close a navtab or Navtab page jump).
The server operation failed after the form was submitted and the client received the StatusCode and message with the error prompt, and the form page is not moving. This makes it easy for the user to see the cause of the error and then directly modify the form data to submit again without having to refill the entire form data. Of course, if you still like to load the HTML page directly after the form submission is no problem, it is no problem to refer to Dwz.ajax.js to expand it.
· The default callback function is automatically invoked after the Ajax form is submitted, and the operation succeeds or fails the prompt.
Add onsubmit= "return validatecallback(this) on the form label;
· If you need to reload a navtab or close dialog after the Ajax form has been submitted, you can use the previously defined method in Dwz.ajax.js Navtabajaxdone/dialogajaxdone
Note: If the form is using Navtabajaxdone on the Navtab page, the form is used on the dialog page Dialogajaxdone
Add onsubmit= "return validatecallback(this, navtabajaxdone)" on the form label
or onsubmit= "return validatecallback(this, dialogajaxdone)"
· After an Ajax form is submitted, you can customize a callback function XxxajaxdoneIf you need to do some other processing. For example, if the following form is successfully submitted, close the current navtab, or reload a tab.
Add onsubmit= "Return Validatecallback (this, Xxxajaxdone)" On the form label
DWZ Framework Ajax non-flush form submission Process