Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 18th, 2004, 02:04 AM
Authorized User
 
Join Date: Nov 2003
Location: Phoenix, AZ, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default defining location for input type file

I'm not sure this is the right forum to ask this question but this is what I'm trying to do:

I have a form with a input element, type file. What I want to happen when a user clicks the Browse button to go get a file is for the "Choose File" dialog to open to a specified location defined by the script. For instance:

<form...>
<input name="Pic" type="file" onClick="getPic()">
</form>

in head...
function getPic() {
  myElement = document.form.Pic;
  path = "ftp://ftpsite/pictures/";
  myElement.value = path;
}

Is it possible to do this? If so, does anyone know how to achieve it?

thanx,
Bob

Reply With Quote
  #2 (permalink)  
Old August 24th, 2004, 08:15 AM
Authorized User
 
Join Date: Aug 2004
Location: Chicago, IL, USA.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The 'value' attribute of the file input box is disabled in IE and Netscape for security reasons. Without that, there's no way to use javascript to open the "Choose File" dialog in a specified location.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
input type="file" grstad Classic ASP Basics 24 January 31st, 2007 07:28 PM
INPUT type=file (Urget Help) surendran PHP How-To 1 April 9th, 2006 12:42 PM
input type file darkhalf Javascript 1 October 29th, 2005 02:17 AM
define location for file input tag bleitner Javascript 6 August 21st, 2004 09:47 AM
<input type="File"> - Specify File Type and Path gp_mk Classic ASP Basics 2 August 2nd, 2004 03:07 AM



All times are GMT -4. The time now is 07:32 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.