Current location: Hot Scripts Forums » General Web Coding » JavaScript » little help with jscript and forms


little help with jscript and forms

Reply
  #1 (permalink)  
Old 10-20-03, 04:11 PM
funkeq funkeq is offline
New Member
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Talking little help with jscript and forms

hey guys

just a little question i want to get a folder path from a user and i want them to be able to browse there own harddrive via a windows explorer window to get the path ?

any ideas on how i can get a file explorer window to pop up after they push a form button? then they select the directory they want and it inputs the info back to my form?

i have seen this done a few times before mostly on file upload sites but all the code is hidden

cheers for your help

tim
Reply With Quote
  #2 (permalink)  
Old 10-20-03, 04:46 PM
Luke Skywalker Luke Skywalker is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Switzerland
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Tim,

there is an input-field type that does exactly what you want. try the following code in your form to let the user choose a file. the accept parameter holds the MIME-type - choose whatever file-type should be choosable (now its images).

<input name="choose_file" type="file" size="50" accept="image/*">

cheers Luke
Reply With Quote
  #3 (permalink)  
Old 10-23-03, 02:43 AM
funkeq funkeq is offline
New Member
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
thanks for your help

hey thanks alot ill look into it

thanks again


Quote:
Originally Posted by Luke Skywalker
Hi Tim,

there is an input-field type that does exactly what you want. try the following code in your form to let the user choose a file. the accept parameter holds the MIME-type - choose whatever file-type should be choosable (now its images).

<input name="choose_file" type="file" size="50" accept="image/*">

cheers Luke
Reply With Quote
  #4 (permalink)  
Old 11-08-03, 07:50 PM
emoboi86 emoboi86 is offline
New Member
 
Join Date: Nov 2003
Location: Annapolis, MD
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How ever, Tim, you should know that you must now address the the "enctype" attribute of your form tag.

<form action="foo.cfm" method="post" name="foo" enctype="multipart/form-data">

If you don't do this, only the text of your file field will be sent. By specifying a multi-part form, you pass the temporary file with it. Just letting you know!

~ben~
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:09 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.