Forums
This topic is locked
Listbox with Hyperlink
Posted 24 Dec 2001 17:56:12
1
has voted
24 Dec 2001 17:56:12 Michael Moore posted:
I am using FSO to build a list in a list box. That works fine. but... I want to have each entity in the list be a hyper link. For instance, in this case, the list will be PDF files. I want the user to be able to click on the link from the list to open the pdf. When I use a href in the list, the text is shown but there is no link. Here is my code.<%For Each file in Files
If lcase(right(file.name,3)) = "pdf" then
response.write "<A HREF=""../" & File.Name & """>" & File.Name & "</A>"
response.write "<br>"
end if
Next
Anybody have and idea? THANKS!
Replies
Replied 24 Dec 2001 21:19:32
24 Dec 2001 21:19:32 Joel Martinez replied:
well, links in a list box wouldnot work beacause links and list boxes are two different entities.
if you need the list in a dropdown, then you need to use the onchange event of the list box to fire some javascript to redirect the browser... either that or display the files as text links.
the code would have to look like this for the dropdown to be correct.<pre id=code><font face=courier size=2 id=code><script>
function fileRedir(box) {
location.href=box.options[box.selectedindex].value;
}
</script>
<select name="thelist" onChange="fileRedir(this)">
<%
For Each file in Files
If lcase(right(file.name,3)) = "pdf" then
response.write "<option value=""../" & File.Name & """>" & File.Name & "</option>"
end if
Next
%>
</select></font id=code></pre id=code>Of course you would want to double check the syntax. since i've got a baby in my arms, I may have miskeyed something.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Edited by - joelmartinez on 24 Dec 2001 21:20:22
if you need the list in a dropdown, then you need to use the onchange event of the list box to fire some javascript to redirect the browser... either that or display the files as text links.
the code would have to look like this for the dropdown to be correct.<pre id=code><font face=courier size=2 id=code><script>
function fileRedir(box) {
location.href=box.options[box.selectedindex].value;
}
</script>
<select name="thelist" onChange="fileRedir(this)">
<%
For Each file in Files
If lcase(right(file.name,3)) = "pdf" then
response.write "<option value=""../" & File.Name & """>" & File.Name & "</option>"
end if
Next
%>
</select></font id=code></pre id=code>Of course you would want to double check the syntax. since i've got a baby in my arms, I may have miskeyed something.
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Edited by - joelmartinez on 24 Dec 2001 21:20:22
Replied 25 Dec 2001 15:30:40
25 Dec 2001 15:30:40 Michael Moore replied:
thanks joel, i dont have a lot of jscript experience yet but that is where I am heading. There seems to be so much more functionality in it. I am now looking up how to use the code sippet you gave me. Mike
Replied 25 Dec 2001 17:30:49
25 Dec 2001 17:30:49 Michael Moore replied:
Joel
Ok, I found the location.href stuff. That makes sense. I do not understand the following:
(this) when calling the function
if I document.write box I get [object]
or if I
document.write box.options[box.selectedindex].value I get
undefined. Do you have any ideas? thanks Mike
Ok, I found the location.href stuff. That makes sense. I do not understand the following:
(this) when calling the function
if I document.write box I get [object]
or if I
document.write box.options[box.selectedindex].value I get
undefined. Do you have any ideas? thanks Mike
Replied 25 Dec 2001 20:31:49
25 Dec 2001 20:31:49 Michael Moore replied:
Thanks Joel, I figured it out. Your solution works great. thanks very much
Replied 26 Dec 2001 16:03:42
26 Dec 2001 16:03:42 Joel Martinez replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Thanks Joel, I figured it out. Your solution works great. thanks very much<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>Awesome! well, I don't usually ask this, but is this script somewhere on the net where I can check it out?
I'd like to see the final js script you worked out... thanks!
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
I'd like to see the final js script you worked out... thanks!
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 27 Dec 2001 21:48:48
27 Dec 2001 21:48:48 Joel Martinez replied:
in case you didn't see it already... I wrote an extension based on this post
www.udzone.com/ShowDetail.asp?NewsId=2106
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
www.udzone.com/ShowDetail.asp?NewsId=2106
Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/
Replied 22 Sep 2006 22:38:26
22 Sep 2006 22:38:26 Cameron Stotz replied:
Hi Joel,
I am trying to build a webpage for our intranet that connects to a share on a file server and displays a list of files in that particular directory. I would like this to be embeded in a web page, and give the user the ability to download these files if they wish, ie. HR Forms, PDFs, Word Docs. Do you have a quick and easy way of doing this within DreamWeaver?
Thanks,
Cameron
I am trying to build a webpage for our intranet that connects to a share on a file server and displays a list of files in that particular directory. I would like this to be embeded in a web page, and give the user the ability to download these files if they wish, ie. HR Forms, PDFs, Word Docs. Do you have a quick and easy way of doing this within DreamWeaver?
Thanks,
Cameron
Replied 28 Sep 2006 17:59:12
28 Sep 2006 17:59:12 Vince Baker replied:
HI cameron,
Came across this extension whilst browsing adobe site and remembered I had seen your question.
This free extension looks to fit the bill exactly!
www.adobe.com/cfusion/exchange/index.cfm?view=sn120#loc=en_us&view=sn121&viewName=Dreamweaver%20Extension&authorid=24652003&page=0&scrollPos=0&subcatid=0&snid=sn121&itemnumber=14&extid=1034786&catid=0
Hope it works for you
Regards
Vince Baker
<strong>DMX Zone Manager</strong>
[VBScript | ASP | HTML | CSS | SQL | Oracle | AS400 | ERP Logic | Hosting]
Came across this extension whilst browsing adobe site and remembered I had seen your question.
This free extension looks to fit the bill exactly!
www.adobe.com/cfusion/exchange/index.cfm?view=sn120#loc=en_us&view=sn121&viewName=Dreamweaver%20Extension&authorid=24652003&page=0&scrollPos=0&subcatid=0&snid=sn121&itemnumber=14&extid=1034786&catid=0
Hope it works for you
Regards
Vince Baker
<strong>DMX Zone Manager</strong>
[VBScript | ASP | HTML | CSS | SQL | Oracle | AS400 | ERP Logic | Hosting]