i am using asp.net and vb.net with the editor
here is what i am trying to do
i have an editor on say a.aspx, i have created a new button on the toolbar which brings up the dialog box, the popup dialog box contains an aspx page which has a text box, a label, a html button and an aspx button control.
what i want to do is when i click on the html button i want to call a javascript function which should get me the selected text from the editor control in a.aspx and display it in a label control.
here is the javascript function
<script type="text/javascript">
function gettext()
{
var oEditor = window.parent.InnerDialogLoaded() ;
var txt=oEditor.FCK.EditorDocument.selection.createRange().htmlText
document.getElementById('<%=Label2.ClientID%>').innerHTML = txt
}
the problem here is that when i click on the html button i get an error that document.getElementById is null or not an object.
i have tried putting an alert to read the txt value which gives me the correct value.also i hve tried declaring txt as
var txt="hii" and then assign it to label which works fine but when i read value from the editor in the parent page and then assign it to the label it gives me that error msg.
i have also divided the above function in to 2 functions first funtion just returns the txt and 2nd one assigns the returned value from the first function to the label, this gives me an error msg that permisson is denied.
i would be greatfull if someone could help me out here i want to know why i am getting the error and how i can solve it.
and also if what i want to do could be done in any other way.
i am new to the editor and javascripting so would be greateful of ur advise
thanks
san
here is what i am trying to do
i have an editor on say a.aspx, i have created a new button on the toolbar which brings up the dialog box, the popup dialog box contains an aspx page which has a text box, a label, a html button and an aspx button control.
what i want to do is when i click on the html button i want to call a javascript function which should get me the selected text from the editor control in a.aspx and display it in a label control.
here is the javascript function
<script type="text/javascript">
function gettext()
{
var oEditor = window.parent.InnerDialogLoaded() ;
var txt=oEditor.FCK.EditorDocument.selection.createRange().htmlText
document.getElementById('<%=Label2.ClientID%>').innerHTML = txt
}
the problem here is that when i click on the html button i get an error that document.getElementById is null or not an object.
i have tried putting an alert to read the txt value which gives me the correct value.also i hve tried declaring txt as
var txt="hii" and then assign it to label which works fine but when i read value from the editor in the parent page and then assign it to the label it gives me that error msg.
i have also divided the above function in to 2 functions first funtion just returns the txt and 2nd one assigns the returned value from the first function to the label, this gives me an error msg that permisson is denied.
i would be greatfull if someone could help me out here i want to know why i am getting the error and how i can solve it.
and also if what i want to do could be done in any other way.
i am new to the editor and javascripting so would be greateful of ur advise
thanks
san
RE: javascript problem with the editor
san