 |
HTML Help Please Search for the answer to your question before asking it! Thanks.
|
| 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> |
|
|
| |
|
|
|
Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group
|