Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2007, 01:56 AM   PM User | #1
novabcfc
New Coder

 
Join Date: Dec 2007
Posts: 18
Thanks: 2
Thanked 0 Times in 0 Posts
novabcfc is an unknown quantity at this point
File opening

Hi I want to create a simple (very) form that my clients can retrieve their pdf document when I upload it to my site.

Simply put, a form that would accept their code in a text box and append it to my site url and thus opening the file.

example
client types 12345.pdf hits submit.
Page /mysite.com/folder/12345.pdf will thus open.

I can do the whole site indexing through my cms but that seems such over kill for a simple file request.
Any help would be appriciated I've been on this all (yep) day.

Cheers
novabcfc is offline   Reply With Quote
Old 12-15-2007, 06:53 AM   PM User | #2
Shoot2Kill
Regular Coder

 
Join Date: Oct 2006
Posts: 181
Thanks: 1
Thanked 6 Times in 6 Posts
Shoot2Kill is an unknown quantity at this point
hope this helps... this file/form would be placed into the /folder/ directory..

this is mainly javascript that does this..

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

window.onload=function() {
   df=document.forms[0];
   df[0].focus();
   df[1].onclick=function() {
if((isNaN(df[0].value))||(df[0].value=='')) {
   alert('enter PDF filename');
   df.reset();
   df[0].focus();
   return;
 }
location.href=df[0].value+'.pdf';
  }
 }

//-->
</script>

</head>
<body>

<form action="#">
<div id="container">
<h1>enter PDF name (excl, .pdf)</h1>
<input type="text"/>
<input type="button" value="OK"/>
</div>
</form>

</body>
</html>
__________________
Quote:
Originally Posted by Excavator
write it for firefox then hack it for IE
Shoot2Kill is offline   Reply With Quote
Old 12-15-2007, 06:45 PM   PM User | #3
novabcfc
New Coder

 
Join Date: Dec 2007
Posts: 18
Thanks: 2
Thanked 0 Times in 0 Posts
novabcfc is an unknown quantity at this point
Shoot2kill

Brilliant just brilliant...
Thank you so much!
novabcfc is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:28 AM.


Advertisement
Log in to turn off these ads.