HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

Download a file form
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> Javascript
View previous topic :: View next topic  
Author Message
DMas50



Joined: 17 Sep 2009
Posts: 1

Posted: Thu Sep 17, 2009 4:47 pm     Download a file form  

I want to create a form where I can have for example customer type in invoice # for ex. 35222. Once submit button is pressed, it would download 35222.pdf file located in invoice folder on my website. I've read all over and can't find anything on the web. Is this possible?
nikki



Joined: 24 Nov 2008
Posts: 132

Posted: Fri Sep 18, 2009 9:44 am      

This code opens a file from the same directory. You need to change the directory

Code: <html>
<head>
   <script type="text/javascript">

   function openFile(){
      var fileName = document.getElementById("invoiceNumber").value;
      
      if(fileName != ""){
         window.open(fileName + ".pdf", fileName);
      }
   }

   </script>

</head>
<body >

   <input type = "text" id = "invoiceNumber"> <input type = "button" onCLick = "openFile()" value = "OpenFile" >
   
</body>
</html>
 
 
DARFUR
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> Javascript
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group