Create

S

simon_desarte

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
%>
 
A

Adrienne

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="<%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top