DanielAc
02-02-2002, 08:34 AM
I have two types of values that are going to be pulled from a database. Those values *WITH* 'http://' appended to the start of the URL and those without. Example:
www.favoritesite.com and http://www.favoritesite.com or someone may even enter something like jamminband.mp3.com.
I need some serverside javascript that will check to see that the http:// is stripped from the DB value before the Response.Write.
So we have.
Response.Write "Home Page: <a href='" & Trim(rs("fldHomePage")) & "'>" & Trim(rs("fldHomePage")) & "</a>"
Is there some way to call a function here like:
Dim hpValue
hpValue = Function(Removehttp://fromvalues) Trim(rs("fldHomePage"))
Response.Write "Home Page: <a href='" & hpValue & "'>" & hpValue & "</a>"
Does it make more sense to do this when the data is being entered? If so how? The processing .ASP page does not have html, head, or body tags.
strHomePage = Trim(Request.Querystring("home"))
' Simple VBScript should do it for posting to the DB
' Lets say record column contains http://www.myband.com then..
If InStr(strHomePage, 1, http://) Then
strHomePage = RTRIM(strHomePage, 7)
End If
Something like this to get started?
www.favoritesite.com and http://www.favoritesite.com or someone may even enter something like jamminband.mp3.com.
I need some serverside javascript that will check to see that the http:// is stripped from the DB value before the Response.Write.
So we have.
Response.Write "Home Page: <a href='" & Trim(rs("fldHomePage")) & "'>" & Trim(rs("fldHomePage")) & "</a>"
Is there some way to call a function here like:
Dim hpValue
hpValue = Function(Removehttp://fromvalues) Trim(rs("fldHomePage"))
Response.Write "Home Page: <a href='" & hpValue & "'>" & hpValue & "</a>"
Does it make more sense to do this when the data is being entered? If so how? The processing .ASP page does not have html, head, or body tags.
strHomePage = Trim(Request.Querystring("home"))
' Simple VBScript should do it for posting to the DB
' Lets say record column contains http://www.myband.com then..
If InStr(strHomePage, 1, http://) Then
strHomePage = RTRIM(strHomePage, 7)
End If
Something like this to get started?