Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I want to populate a combobox in Html with the contents of a file when the page containing the conmbo box is loaded in a browser. The text file contains some names

for example:-
Text file name : "names.txt" and contents are..

apple
boy
cat
dog
elephant

each name is in single line. i want to add these names in a combobox option at run time since these names keeps changing. Hope you understood the problem. please help me as soon as possible with a sample code.

Thanks,
Rahul
Posted
Comments
Sergey Alexandrovich Kryukov 4-Mar-13 23:06pm    
I wonder why having this file. May be this is a good idea, but please explain. Are you going to change this file or something? Why not embed this data in HTML or JavaScript?
—SA
Member 9470684 4-Mar-13 23:28pm    
Actually my requirement as follows.
There is a directory which contain some files. i want to fetch those file names from the directory n load it into the combobox in html page. since the files in the directory keeps changing so the names in combobox must also change according to the contents of the directory. the user accesing the webpage should be able to select a filename from the combobox.
Sergey Alexandrovich Kryukov 5-Mar-13 0:39am    
On client side? All of those artifacts? Why? Do you have any server-side technology, by the way?
And I still don't know to purpose of it; it does not sound reasonable to me...
—SA
Member 9470684 5-Mar-13 2:08am    
ya, i want the client to see the files that are available in the directory, without giving him the access to browse that directory. so i just want to show the files that are currently inside the directory when the page is loaded.we are using shell scripts and a perl.
Sergey Alexandrovich Kryukov 5-Mar-13 2:22am    
Do you understand that JavaScript has no access to local system? The whole think is just the bad idea.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900