QUOTE(Casper @ Sep 5 2006, 12:19 PM)
QUOTE
Why not disable the editable mode before you want to use the link?
My html editor works like a TextArea where user can input notes to save them and can also view saved notes.
Why use the contenteditable/designmode then? These are for WYSIWYG-style editing.
QUOTE
But it is always in editable mode. I cant turn off editable mode.
It's possible with java script:
CODE
if(document.body.contentEditable)
{
document.body.contentEditable=false; // use "true" to turn it on
}
else if(document.designMode)
{
document.designMode='off'; // use "on" to turn it on
}
You can also apply contentEditable to individual element (as opposed to the whole BODY), but I can't remember if designMode lets you do that.
QUOTE
As it detects hyperlinks as they are typed, I thought their might be some easier way to make these links navigable from within the editor just as when composing an email message in Yahoo mail.
I'm not familiar with Yahoo mail, but I don't think you
should make links work as links when editing them WYSIWYG-style: the user must click an existing link in order to edit its link text, but as soon as the link is clicked the URL is changed.
QUOTE
QUOTE
Otherwise, in IE it might be possible to use the onclick event on links while they are editable (and then make a javascript redirect from that), but I couldn't make this work properly.
Can you please suggest some way of doing it? There may be multiple hyperlinks and I want to navigate user to a particular link when user clicks it.
I was thinking of something like
CODE
onclick="window.location.href=this.href"
in the link(s) with javascript. But again, this probably doesn't work.