jonas sabu
19 Mar 2012, 3:01 PM
Hi all,
I am trying to get the selected text within a HTML Editor to a String.
I have read that it can only be done using native javascript.
I have tried this (http://www.codetoad.com/javascript_get_selected_text.asp) but couldn't figure out how to get the selected text from the html editor.
What I have is (Underlined text is the selected text):
HTMLEditor editor = new HTMLEditor();
editor.setValue("Test phrase for selection Test);
What I want is:
String selection = editor.getSelection();
// selection should be = hrase fo
Anyone can help?
Thanks in advance
I am trying to get the selected text within a HTML Editor to a String.
I have read that it can only be done using native javascript.
I have tried this (http://www.codetoad.com/javascript_get_selected_text.asp) but couldn't figure out how to get the selected text from the html editor.
What I have is (Underlined text is the selected text):
HTMLEditor editor = new HTMLEditor();
editor.setValue("Test phrase for selection Test);
What I want is:
String selection = editor.getSelection();
// selection should be = hrase fo
Anyone can help?
Thanks in advance