This is a discussion on "Formatting a string as a hyperlink" within the Classic ASP section. This forum, and the thread "Formatting a string as a hyperlink are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Formatting a string as a hyperlink
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Formatting a string as a hyperlink
Forgive the probably simple problem for you folks but here's what I'd like to do
I need to format the following string (ouputted from an access database) as a hyperlink opened in a new window <td><%=(rsLinks.Fields.Item("url").Value%></td> I've tried various permutations of this but nothing formats it properly Your suggestions would be appreciated John |
|
|
|
|||
|
There's a lot of ways to do this but the simplest is
There should be a space after the 'a' in 'ahref' (forum tried to make it into a link without it). And I would use the shorthand for
|
|
|||
|
Thanks very much that worked like a charm
|
|
|||
|
I don't know how confident you are that the URLS in your database all have http:// in front of them, but I know that in the past I have had to check it was there so this might be useful.
'## 1st put the DB field into a temporary string strURL = rsLinks("url") '## now see if the first 4 characters or strURL are "http" and if not, make it so they are "http://" If Lcase(Left(strURL,4))<>"http" then strURL="http://" & strURL End if Then use the same code as earlier <td><%=strURL%></td> |
![]() |
| Tags |
| formatting, string, hyperlink |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hyperlink Rollovers | crackafaza | Web Page Design | 3 | Aug 24th, 2007 11:43 |
| Hyperlink buttons | scoopslack | Flash & Multimedia Forum | 3 | Mar 8th, 2007 13:02 |
| Javascript Hyperlink | kato77 | JavaScript Forum | 1 | Feb 11th, 2006 12:14 |
| Returning result from db as a hyperlink | lobster1983 | PHP Forum | 2 | Sep 18th, 2005 19:59 |