Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Javascript button is not working after the download.

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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";
doc.form.submit();
}


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



<SCRIPT>

<INPUT TYPE="button" value="Download" onclick="return csvDownlaod();">
Submit
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
He's giving us the slip! Quick! Grab this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic