Display Hyperlinks from Stored Text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • schmoolie
    New Member
    • Feb 2008
    • 2

    Display Hyperlinks from Stored Text

    Hi -

    I have a job board site where users input position descriptions and "how to apply" information. Invariably, the How to Apply field contains email and web addresses that display as plain text when I show them on dynamically-generated pages. How do I get hyperlinks to show up? I'm a beginner, using asp and Sql Server.

    Thanks for any help you can provide.
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello schmoolie,

    Here are a few examples:

    Example 1:
    [code=asp]
    <%response.writ e("<a href='www.Micro soft.com'>Micro soft</a>")%>
    [/code]

    Example 2
    [code=asp]
    <%response.writ e("<a href='" & MyRs("DatabaseU RL") & "'>" & MyRs("DatabaseS iteName") & "</a>")%>

    [/code]

    Hope it help you out~

    Comment

    • schmoolie
      New Member
      • Feb 2008
      • 2

      #3
      Thanks, but I'm looking for something that will display a textfield that includes a bunch of plain text with a hyperlink embedded in it. I don't want to display the entire text output as a hyperlink, just the portion of it that's a web address or an email address. This will likely be embedded somewhere in an unpredictable place in the text.




      Originally posted by CroCrew
      Hello schmoolie,

      Here are a few examples:

      Example 1:
      [code=asp]
      <%response.writ e("<a href='www.Micro soft.com'>Micro soft</a>")%>
      [/code]

      Example 2
      [code=asp]
      <%response.writ e("<a href='" & MyRs("DatabaseU RL") & "'>" & MyRs("DatabaseS iteName") & "</a>")%>

      [/code]

      Hope it help you out~

      Comment

      • CroCrew
        Recognized Expert Contributor
        • Jan 2008
        • 564

        #4
        Are you saying that you want to embed a hyperlink within a <textarea> of a <form>?

        Comment

        • CroCrew
          Recognized Expert Contributor
          • Jan 2008
          • 564

          #5
          As far as I know you cannot have active HTML code in a <textarea>. What you could do is use a Rich Text Area that would allow you to use HTML. But, this would not be a <form> element. But again, with some advanced JavaScript you could pull the information out of the Rich Text Area and submit it along with a <form> if need be.

          Here is some code:
          Code:
          <html>
          	<head>
          		<title>Example</title>
          		<style>
          			#xTextArea 
          			{ 
          				height: 200px; 
          				width: 400px; 
          				border: medium inset #CCCCCC; 
          				overflow: auto; 
          			} 
          		</style>
          	</head>
          	<body>
          		<div id="xTextArea"> 
          			 This is a link to <a href='www.Microsoft.com'>Microsoft</a> home page.<br>
          			 <%response.write(MyRs("MessageFromDatabase")%>
          		</div> 
          	</body>
          </html>
          Hope this helps~

          Comment

          Working...