setting cuteeditor text links

Last post 06-08-2005, 11:46 AM by Adam. 3 replies.
Sort Posts: Previous Next
  •  01-24-2005, 6:42 PM 3677

    setting cuteeditor text links

    I haven't gotten a response on this issue.  When i retrieve data from a database to set the cuteeditor text as, i set the editor text as follow:  ce.text = data

    unfortunately, as opposed to treating it as literal html code, it treats it as if I had set a label to equal the text.  when this happens, it does not allow my links to be set properly and instead, displays it the way a .NET label would: The text appears properly, but the link does not.  so if it cnn.com should appear as a link, it does but the href tag sets it to my site's url.  I unfortunately, cannot direct you to the page as it is on an Intranet. 

    My main issue is I do not want to set the text of the box--i need to set the HTML value of the box.  Is that possible or is there a work around?

    Thanks!
    Alice
  •  01-24-2005, 7:56 PM 3682 in reply to 3677

    Re: setting cuteeditor text links

    Alice,
     
    Sorry, I am still confused about what you are trying to achieve.
     
    But I can provide a way to access Cute Editor Text from client side javascript.

    // get the editor client ID
    var editor1=document.getElementById('<%=Editor1.ClientID%>');
     
    //Get the editor content 
    var editdoc=editor1.GetDocument();

    // Get the editor innerHTML
    alert(editor.innerHTML);

    //Get the editor InnerText
    alert(editor.InnerText);

    //Set the editor innerHTML
    editdoc.body.innerHTML="your innerHTML here";

    //Set the editor InnerText
    editdoc.body.InnerText= "your innerText here";


    Hope it helps.

    Let me know if you have any further questions.


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-25-2005, 10:38 AM 3692 in reply to 3682

    Re: setting cuteeditor text links

    Thank you Adam.  Let me clarify what I'm doing; I'm sorry to be confusing.

    I have a webform with several editor boxes.  Users will input various text into the boxes which may include links and formatted items.  The users have no knowledge of HTML so they will only be inputting information in the NORMAL setting of the editor.  A submit button exists on the form that will take the HTML value of every box and insert them into a SQL database table.  A user may go back and want to change the inputted text of those boxes.  This is where the problem occurs.  The form is supposed to load and input the database table HTML text value into each appropriate editor box.  What I initially did was set it so that the text value of each box equals the database returned text.  The problem arises with links: links are interpretted by the text value of the editor the same way a label would interpret it: it sets the link to the server value as opposed to what the link is supposed to be and doesn't put the </a> closing tag into the proper place.   For example, if i had a cnn.com link, and my server was http://chilton, instead of producing <a href="http://cnn.com">cnn.com</a> it would produce <a href="http://chilton">cnn.com and some additonal text from the database table but should not be linked</a>. I could think of a couple theorectical solutions:

    (1) set the literal HTML value of the editor box onload to equal the text returned from the database in which a javascript solution wouldn't be the best solution, but I would need to do this in the code behind of the form, not via javascript because the form won't be able to set the value of the text boxes onload after I retrieve the database information so it would not set the values at all.
    (2) If a user inputs a URL like http://www.cnn.com, I want it so the text box will not automatically make it a link--just leave it as text--is there a way to do that?

    Thanks for your time!
    Alice
  •  06-08-2005, 11:46 AM 7343 in reply to 3692

    Re: setting cuteeditor text links

View as RSS news feed in XML