DWZ Framework Ajax non-flush form submission Process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.