I have some legacy code that uses http://jquery.malsup.com/form/. The legacy code, takes search parameters from a form , makes a DB query and display the results back. (Using Java Servlets)
ajaxForm was used by registering the output of form to go to a particular target (div).
Now we need to add Export functionality. When we create the excel file and set the contentType and Content Disposition like below, still the excel file is not coming as a 'Save As' popu-up, instead it goes to the same 'div' and excel content is splashed on the html division with strange characters.
response.setContentType("application/vnd.ms-excel; charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename="+ "Report" + ".xls");
I would like to know if there's a way to disable the registration of target to that specific div for 'excel output requests and enable it back for regular search requests.
I referred to this link - Better way to temporarily disable ajax submission on ajaxForm plugin , but still clueless. Thanks for any help.