Submissions send requests and Fore gives you a lot of options to deal with the response to
that requests by setting the replace attribute.
What to do with the response data a server might send us back?
The replace attribute allows several ways of dealing with response data.
Just sends the data but ignores the response
You won't notice a difference unless you're using a developer tool to inspect the network requests. However there will be a toast message when it succeeds.
Sends the data and replaces the default instance with response
Sends the data and replaces the instance with id='replaced'
Replaces the whole viewport (window) with response. However that will not change the URL shown in the browser location bar.
The target attribute is mandatory in this case and is an XPath here pointing to filename ('saved.xml')
In this example the fx-send action sets the target dynamically. You can also specifiy it statically
on the fx-submission element directly.
Replaces some HTML at target position. target is a CSS selector pointing to the wanted element.
expects a URL returned as simple string and redirect to that.
If something goes wrong the 'submit-error' event will fire.
If something goes wrong the 'submit-error' event and set status code and message