I have a situation here: A HTML form page, on submit returns Excel/PDF/Word document based on POST values, if NOT returns an Error HTML.
With respect to friendly UI, wants to download if everything is fine OR show an error dialog WITHOUT NAVIGATING TO error page. Download works fine. But in case of HTML it navigates based on the response.
Other details:
- Backend set content-type to "application/pdf" or whatever
- Using jQuery/UI dialog in the front end.
- Using jQuery form submit:
$("#form").submit();
Any help?