473,412 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Populating a drop-down box from the names of text files in a folder

Hi there,
I'm pretty new at JavaScript and I'm wondering if it is possible to
dynamically fill up a drop-down box (on a html form) with the names of
all of the .txt files which are stored in a particular folder.

I am aware that JavaScript has restricted file operations for security
reasons and so it may not be possible to do this.

If anybody is aware of how to do this or knows if it cannot be done,
any clues on how to approach this would be greatly appreciated.

Thankyou

Matt
Jul 23 '05 #1
3 1499
In article <c7**************************@posting.google.com >,
ma***********@hotmail.com enlightened us with...
Hi there,
I'm pretty new at JavaScript and I'm wondering if it is possible to
dynamically fill up a drop-down box (on a html form) with the names of
all of the .txt files which are stored in a particular folder.

I am aware that JavaScript has restricted file operations for security
reasons and so it may not be possible to do this.

If anybody is aware of how to do this or knows if it cannot be done,
any clues on how to approach this would be greatly appreciated.


If and how can't be answered until we know if the script is accessing
files on the server or the client.

Which way do you want it? Javascript on the client, looking at client
files? That can only be done (AFAIK) with an HTA, which requires windows
and MSIE. Or do you want Javascript to access files on the server? That
can be done a few different ways to work around the client/server issue,
but it most efficiently done with a server-side script.

--
--
~kaeli~
Murphy's Law #2000: If enough data is collected, anything
may be proven by statistical methods.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Thanks for your post,
I'm sorry I forgot to specify, It will be to read files from the server.

Matt

kaeli <ti******@NOSPAM.comcast.net> wrote in message news:<MP************************@nntp.lucent.com>. ..
In article <c7**************************@posting.google.com >,
ma***********@hotmail.com enlightened us with...
Hi there,
I'm pretty new at JavaScript and I'm wondering if it is possible to
dynamically fill up a drop-down box (on a html form) with the names of
all of the .txt files which are stored in a particular folder.

I am aware that JavaScript has restricted file operations for security
reasons and so it may not be possible to do this.

If anybody is aware of how to do this or knows if it cannot be done,
any clues on how to approach this would be greatly appreciated.


If and how can't be answered until we know if the script is accessing
files on the server or the client.

Which way do you want it? Javascript on the client, looking at client
files? That can only be done (AFAIK) with an HTA, which requires windows
and MSIE. Or do you want Javascript to access files on the server? That
can be done a few different ways to work around the client/server issue,
but it most efficiently done with a server-side script.

--

Jul 23 '05 #3
In article <c7**************************@posting.google.com >,
ma***********@hotmail.com enlightened us with...
Thanks for your post,
I'm sorry I forgot to specify, It will be to read files from the server.


Do you have ANY server-side scripting capabilities?
Even a cgi-bin for perl? Or SSI?

I have a javascript code snippet that will fill a select element dynamically
using a cgi script. Only works in DOM browsers, though.

If you have no server-side scripting at all, you'll need to have something
that runs on the server to get that list into a text file so javascript can
include it. Or you'd need a java applet, which can read files from the server
and talk to javascript.

If you're using only MSIE, we might be able to use a COM or ActiveX, too. I'd
have to check into it, but I'm pretty sure you're not the first to want this,
so someone probably has written one already.

--
--
~kaeli~
Punctuation, capitalization, and grammar are your friends,
and will help people think that you aren't such an ignorant
moron, after all.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lamine Darbouche | last post by:
Can anybody help? I need to have three list boxes automatically populating each other, (ie when region is selected from the first listbox, it will populate automatically the second one which is...
2
by: enigma261 | last post by:
Hi, I am a XML beginner. I need some guidance in intrepreting a XML file and then populating my object model. Following is an example of the XML file .. <Tom> <Version>x.0</Version>
2
by: Janus | last post by:
Hello. I need a little advice for populating the treeview control. I dont want my application to hang while populating the treeview, there is a lot of data what's the best approach? Maybe...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
1
by: Patrick.O.Ige | last post by:
Doing the simple DropDown List binding using the method NextResult() But its just not populating .. what am i missing Its populating the 3 DropDwonList but no Data? Private Sub...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
2
by: wcaruso | last post by:
Good afternoon. I'm in the midst of writing up a pretty "basic" web form and having some difficulties. I'm completely open for suggestions. I'm using VS.net 2003, and what iwould like to...
18
by: blueapricot416 | last post by:
I am on a team designing the front end of an Intranet application. The backend guys will be using JSP and AJAX-like functionality to make server requests that must dynamically change elements on a...
1
by: 47computers | last post by:
I have a couple of DropDownLists in a DetailsView control (your classic country/state lists) and I need one to be populated based on the current selection of the other. Currently this works fine...
0
by: Eric B. | last post by:
I am populating a DataGrid with many rows. As it is populating I see the scrollbar flying but no rows pop up until it is finished. Is there a way to make each row draw as soon as it is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.