Closed brandbrilliance closed 9 years ago
How does the try-catch help? The output will still not work?
If the reply contains a JSON object which can be decoded to obtain the return text, it will do it and then show the confirm message. Otherwise, it fails, skips the JSON decode and then simply returns the template to replace the current form.
This is obsolete as we're no longer using JSON
I've had to add a try block to all the templates. I noted that the TPL template was missing this part anyway.
onComplete function in templates, wrap the decode in a try block, because if the FORM is returned with errors, that cannot be decoded, and shouldn't.
I've also added a submit "loading" class to the button, so you can use a loader graphic in the background, or dim the button.