Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Cool Output Hyperlink

    Hi,

    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.

    Lebron

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Why not just response.write the information, rather than trying to wrap it in a textarea (for display)?

    For example:

    <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.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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!

    Thanks again.

    Lebron

  • #4
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Cool

    It is an example of an output that not works!
    <form>
    <!--<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)">
    <br><div id="t2"></div>
    </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.

    Lebron

  • #5
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    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.

    Code:
    if request.form("ypslon") <> "" then
      strSQL = UPDATE yourTable SET ypslon = '" & replace(request.form("ypslon"),"'","\'") & vbCrLf & vbCrLf & "' WHERE yourID = " & session("id')
    '
    end if
    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:

    Code:
    <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:

    Code:
    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>"
    end if
    When viewing:
    this is your <%= rs("hyperlink") %>

    will result in
    this is your hyperlink

    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.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #6
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Daemonspyre,

    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;

    var stuff=document.form1.pageContent.value.split('.');

    var string=document.form1.pageContent.value;


    Thank you again

    Lebron

  • #7
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Quote Originally Posted by lebronletchev View Post
    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:

    <textarea><%=myStringOfRawHTML%></textarea>

    ?

    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 &lt;, and all > with &gt;.

    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"

  • #8
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?

    Thanks

    Lebron

  • #9
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    WebWiz is a good one. Has a lot of different options and is easy to work with.

    http://www.webwizguide.com/
    http://www.richtexteditor.org/

    Follow Spudhead's advice and google WYSIWYG editors.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #10
    Regular Coder
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    149
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you. It is great!

    Lebron


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •