473,509 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create

Hi There,

I am hoping somebody can point me in the right direction - I have
created an ASP page which creates a list of all documents in a given
folder (testfolder in the root). (Code is pasted below)
What I would like to do is create a form checkbox after each file link,
how would I create this so that a new unique checkbox is created for
each individual file.

Could anybody give me any pointers please

Many Thanks

Simon
<% FolderList(Server.MapPath("testfolder")) %>

<% sub FolderList(path)

dim fso, fldr, file, item, url

set fso = CreateObject("Scripting.FileSystemObject")
Response.Write(fso.GetFolder(path))
set fldr = fso.GetFolder(path)

for each item in fldr.Files
url = RepURL(item.path)
Response.Write("<li><a href=""" & url & """>" & item.Name _
& "</li>" & vbCrLf)
next

Response.Write("</ul>" & vbCrLf)
Response.Write("</li>" & vbCrLf)

end sub

function RepURL(path)

dim rootPath, url

rootPath = Server.MapPath("/")
url = Right(path, Len(path) - Len(rootPath))
RepURL = Replace(url, "\", "/")

end function
%>

Aug 3 '05 #1
1 1449
Gazing into my crystal ball I observed "si***********@yahoo.co.uk"
<si***********@yahoo.co.uk> writing in news:1123027232.741182.63770
@g14g2000cwa.googlegroups.com:
Hi There,

I am hoping somebody can point me in the right direction - I have
created an ASP page which creates a list of all documents in a given
folder (testfolder in the root). (Code is pasted below)
What I would like to do is create a form checkbox after each file link,
how would I create this so that a new unique checkbox is created for
each individual file.

Could anybody give me any pointers please

Many Thanks

Simon
<% FolderList(Server.MapPath("testfolder")) %>

<% sub FolderList(path)

dim fso, fldr, file, item, url

set fso = CreateObject("Scripting.FileSystemObject")
Response.Write(fso.GetFolder(path))
set fldr = fso.GetFolder(path)

Put in a counter.
for each item in fldr.Files counter = counter + 1 url = RepURL(item.path)
Response.Write("<li><a href=""" & url & """>" & item.Name _
& "</li>" & vbCrLf)
%>
<input type="checkbox" name="fieldname" id="id<%=counter%>" value="<%
=item.Name%>><%=item.Name%><br>
%>
next

Response.Write("</ul>" & vbCrLf)
Response.Write("</li>" & vbCrLf)

end sub

function RepURL(path)

dim rootPath, url

rootPath = Server.MapPath("/")
url = Right(path, Len(path) - Len(rootPath))
RepURL = Replace(url, "\", "/")

end function
%>


--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Aug 3 '05 #2

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

Similar topics

7
8823
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
4
4385
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
10
8770
by: Zack Sessions | last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command and ADO.NET? If so, is there a trick in trapping a SQL error when trying to create the view? I have a VB.NET app that, amoung...
9
8252
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
37
3245
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
18
2682
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
5
4859
by: Michael | last post by:
Hello, I've created an ASP web page where users in our organization can create Active Directory computer accounts. The web page is running on a Server 2003 SP1 IIS 6 installation. The...
8
20327
by: barb | last post by:
So that the world at large benefits from our efforts, here is one fully documented way to use Windows Irfanview freeware to create thumbnail web galleries (http://www.irfanview.com). STEP 1:...
2
22559
by: masri999 | last post by:
I have a requirement in SQL 2005 in Development database 1. Schema dbo owns all objects (tables,views,SPs,UDFs etc) . 2. Only DBA's ( who are database owners ) can create, alter tables ....
4
3728
by: JohnnyDeep | last post by:
I am trying to create a store proc that contain a create index with the cluster option and I receive DB21034E The command was processed as an SQL statement because it was not a valid Command...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7069
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
5652
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,...
1
5060
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
4730
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...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
441
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.