You are reading O'Reilly XForms Essentials by Micah Dubinko. (What is this?) - Buy XForms Essentials Online

What Happens After Submit?

If you've ever bought something online, after submitting the order, you've probably seen a page that says "please print this for your records." One of the capabilities of HTTP is that a GET or POST returns a result page.

When looking at the response to a submission, there are two main things to consider: Does the response contain a body? And was the submission attempt successful? If the attempt is non-successful, then the form will always remain in the current display (or auditory context, or whatever). If the submission is successful, however, more results are possible.

In HTML forms, the response from a form submission always replaces the entire currently displayed document. This behavior is also the default in XForms, and is expressed through the attribute replace="all" on <submission>. Other possible values for that attribute open other interesting possibilities. One possibility is replace="instance", which takes an XML-based response and replaces the just-submitted instance data with the newly-arrived stuff. Another option is replace="none", which disregards any response document. Future versions of XForms might offer even more possibilities, such as replacing only part of the instance data.

For any replacement to happen, the response must include a body. In many cases (such as mailto or file submission), there won't be any response body.