View Full Version : Output Hyperlink
07-02-2007, 05:04 PM
I am working with a database using memos with hypertext, however I have a problem: How output the hypertext hidden the TAGS?
I was trying output to <textarea>, but it donīt supports hypertext. I have the RTF editor option, but I donīt how output my memo to RTF editor.
Thank you for any suggestion.
07-02-2007, 05:51 PM
Why not just response.write the information, rather than trying to wrap it in a textarea (for display)?
<div id="textDump" style="width: 85px; height: 85px; overflow: auto;"><%= rs("text_area") %></div>
For editing, you are going to have to either use IFRAMES and JS/ASP URL Encoding, or use stylesheets (as in here at CF) to wrap URL blocks around text for the hyperlinks.
07-02-2007, 07:01 PM
My problem is I am trying do magic with hypertext inside a memofield.
I have a database and the memofield is pure hypertext.
Are 2 cases:
1. How I output memofields like hypertext in text no tags?
2. Although I use "response.write" sometimes the the output, instead of
hypertext show the tags!
07-02-2007, 07:11 PM
It is an example of an output that not works!
<!--<textarea name="t1" rows=5 cols=70>
The first case study is based on a third party logistics company which specialises in the frozen food temperature controlled distribution sector. The company uses both the Transtore Warehouse Management System and Transfreight Traffic Management System with full RF Radio Data Terminals with bar code scanning. </textarea><br>-->
<INPUT NAME="ypslon" TYPE="text" value=<%response.write rs1("texts") & "<br><br>"%> size=2 textwidth=2><BR>
<br><input type="text" name="what" value=<%response.write rs1("texts") & "<br><br>"%> >
<input type="button" value="Go" onClick="contr(this.form)">
The original form was a JS outpur, not I am trying use the script for output my memofield written in ASP. No success!
Thank you for any help.
07-02-2007, 09:08 PM
Hi Lebron --
The textarea works fine for me. Can you provide an example of what you cannot get to work?
The INPUT types don't, though. You cannot put <br> into a INPUT TYPE="text". They weren't designed to do that.
If you want to enter in carriage returns, do that after the form POST.
if request.form("ypslon") <> "" then
strSQL = UPDATE yourTable SET ypslon = '" & replace(request.form("ypslon"),"'","\'") & vbCrLf & vbCrLf & "' WHERE yourID = " & session("id')
Now, this is a very simple SQL statement, but it fixes the issue of carriage returns.
Now, if you want to set them to be hyperlinks, then try it this way:
<label for="hyperlink">Enter the URL for your hyperlink: </label><input type="text" name="hyperlink" size="40" value="<%= rs("hyperlink") %>"><br />
<label for="hypertext">Enter the text for your hyperlink: </label><input type="text" name="hypertext" size="80" value="<%=rs("linktext")%>">
Again, a simple SQL UPDATE statement:
if request.form("hyperlink") <> "" AND request.form("hypertext") <> "" then
strSQL = "UPDATE yourTable SET hyperlink = '<a href=""" & replace(request.form("hyperlink"),"'","\'") & """>" & replace(request.form("hypertext"),"'","\'") & "</a>"
this is your <%= rs("hyperlink") %>
will result in
this is your hyperlink (http://www.codingforums.com)
Does that help?
If not, send me some more examples of what you cannot get to work and I will help out as best I can.
07-02-2007, 09:57 PM
Thnak you for your attention.
Indeed the <textarea> works fine. WHAT DONīT WORKS is the output of my hypertext. WHY? According your suggestions I did a change from TEXTAREA to IFRAME. Ok. tHE iFRAMES accpets Hypertext, however, I have a lot of functions written for working with TEXTAREA not IFRAMES and I donīt change it, but I have a bit of immagination to know where I must to change!
I will give some examples (code lines in my js functions for working with textarea).
str = theForm.pageContent.value;
document.form1.pageContent.value = opener.document.form1.pageContent.value;
Thank you again
07-03-2007, 11:59 AM
WHAT DONīT WORKS is the output of my hypertext. WHY?
I'm not sure I fully understand what you're trying to do. Something like this:
That's not going to work. If you want HTML code to show up in the texarea, you're going to have to edit it as it comes out of the database so that when you write it to the browser, it doesn't think it's ACTUAL HTML and tries to parse it. This means, basically, that you replace all < with <, and all > with >.
If, on the other hand, you want HTML formatting to be applied to text in a textarea.... see the iFrame suggestion. Or Google "WYSIWYG textarea"
07-03-2007, 01:37 PM
Not works indeed.
The unique or best solutions for my ask is RTF editor.
Do you know any scrip`t written in ASP for working with RTF Editor?
07-03-2007, 01:46 PM
WebWiz is a good one. Has a lot of different options and is easy to work with.
Follow Spudhead's advice and google WYSIWYG editors.
07-03-2007, 04:05 PM
Thank you. It is great!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.