Hi,
I have a need to copy text from a field in the child window and paste it into a radtextbox on the parent window. The copy part works fine. It's the pasting that does not happen well. Here is the code that I am using to paste the copied text into the radtextbox field. I see the text being pasted, but the textbox flashes immediately and wipes out my pasted data. Please tell me how I can correct it.
storeCaretPosition = document.selection.createRange();
controlcontext = control;
function insertAtCaret (text)
{
var textEl = controlcontext;
if (textEl != null)
{
if (textEl.createTextRange)
{
textEl.caretPos =storeCaretPosition.duplicate();
}
if (textEl.createTextRange && textEl.caretPos)
{
var caretPos = textEl.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text+' ';
}
else
{
textEl.value = text;
}
textEl.focus();
}
Thank you!
vithiya
I have a need to copy text from a field in the child window and paste it into a radtextbox on the parent window. The copy part works fine. It's the pasting that does not happen well. Here is the code that I am using to paste the copied text into the radtextbox field. I see the text being pasted, but the textbox flashes immediately and wipes out my pasted data. Please tell me how I can correct it.
storeCaretPosition = document.selection.createRange();
controlcontext = control;
function insertAtCaret (text)
{
var textEl = controlcontext;
if (textEl != null)
{
if (textEl.createTextRange)
{
textEl.caretPos =storeCaretPosition.duplicate();
}
if (textEl.createTextRange && textEl.caretPos)
{
var caretPos = textEl.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text+' ';
}
else
{
textEl.value = text;
}
textEl.focus();
}
Thank you!
vithiya