Setup:
To See the Problem:
<telerik:radeditor runat=
"server"
id=
"RadEditor1"
OnClientSelectionChange=
"OnClientSelectionChange"
>
<Content>
<input type=
"text"
style=
"width: 100px; height: 22px;"
/><input type=
"number"
style=
"width: 100px; height: 22px;"
/><textarea></textarea>
<input type=
"range"
style=
"width: 100px; height: 22px;"
/>
<input type=
"date"
style=
"width: 100px; height: 22px;"
/>
<input type=
"datetime-local"
style=
"width: 100px; height: 22px;"
/>
<input type=
"month"
style=
"width: 100px; height: 22px;"
/>
<input type=
"time"
style=
"width: 100px; height: 22px;"
/>
<input type=
"week"
style=
"width: 100px; height: 22px;"
/>
</Content>
</telerik:radeditor>
<input type=
"button"
value=
"Paste Content"
onclick=
"InsertSpan(); return false;"
/>
<script type=
"text/javascript"
>
function
OnClientSelectionChange(editor, args) {
alert(
"active element: "
+ document.getElementById(
'RadEditor1_contentIframe'
).contentWindow.document.activeElement +
"\n"
+
"RadEditor getSelectedElement is: "
+ editor.getSelectedElement() +
"\n"
+ editor.getSelectedElement().getAttribute(
"type"
));
}
var
$E = Telerik.Web.UI.Editor;
var
utils = $E.Utils;
var
$ = $telerik.$;
$E.Utils.isTextElement =
function
(node) {
return
utils.isTag(node,
"textarea"
) || (utils.isTag(node,
"input"
) && $(node).is(
":not([type]),[type=text],[type=password],[type=number],[type=range],[type=date],[type=datetime-local],[type=month],[type=time],[type=week]"
));
}
</script>