wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript button is not working after the download. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript button is not working after the download." Watch "Javascript button is not working after the download." New topic

Javascript button is not working after the download.

Mike Thomson
Ranch Hand

Joined: Nov 07, 2007
Posts: 115

I have a simple jsp page with input text fields and select drop downs.
I have 3 buttons. one for submit, download and cancel.
Whenever I click the download button, it will download the csv files (will ask for default popup to open/save/cancel).
Now, when I am clicking the submit/cancel after the download button, I am enountering an issue and the problem is again the default popup is opening and askinfg for download.
I thought the problem miught be with javascript document object and declared the document object globally and I couldn't able to resolve the issue.
Any inputs will be helpful?

<SCRIPT language="JavaScript">

var doc = document;

function csvDownlaod(){
doc.form.cycle.value = "4";

function submitResult(){
doc.form.cycle.value = "1";


<INPUT TYPE="button" value="Download" onclick="return csvDownlaod();">
David Newton

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

You can edit your post by using the button.
I agree. Here's the link: http://aspose.com/file-tools
subject: Javascript button is not working after the download.
Similar Threads
My Cancel button is not working in struts1.2
how i can reload the main form without showing the retry/cancel dialog box
How to retrieve string representation of <INPUT> value?
Problems with action
automatic form submit