Opened 16 years ago

Last modified 13 years ago

#1903 closed Bug

Cursor is not coming when string inserted via javascript — at Initial Version

Reported by: Mayank Parmar Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.5.1
Keywords: Cc:

Description

Don't know if it is problem of FCKeditor or Javascript I have written but although I am writting here. I hope you can help me.

I have put FCKeditor on ASP.net 2.0 application (www.relationshiplist.us)

This is code of fckeditor on my main page:

<fckeditorv2:fckeditor id="FCKeditor1" runat="server" BasePath="~/FCKeditor/" SkinPath="skins/office2003/" ForcePasteAsPlainText="true" Height="924px"></fckeditorv2:fckeditor>

Also one button is there

<input id="inpbtnInsertMergeTop" type="button" value="Insert Merge Field" onmousedown="test()" />

Javascript for that function:

function test()

{

var FCK = FCKeditorAPI.GetInstance('<%=FCKeditor1.ClientID %>') ; FCK.InsertHtml('{u_mergefield}'); delete FCK; newwin=window.open('Selection.aspx',null,"left=300,top=100,height=200,width=200,status=yes,titlebar=no,toolbar=no,menubar=no,location=no"); newwin.focus();

}

Code on pop up window : <table style="font-family:Verdana; font-size:small"> <tr><td>First Name </td><td> <input id="Radio1" type="radio" Value="{u_fname}" onclick="updateparent(this)" /></td></tr>

<tr><td>Last Name </td><td> <input id="Radio2" type="radio" Value="{u_lname}" onclick="updateparent(this)" /></td></tr> <tr><td>Street </td><td> <input id="Radio3" type="radio" Value="{u_street}" onclick="updateparent(this)" /></td></tr> <tr><td>City </td><td> <input id="Radio4" type="radio" Value="{u_city}" onclick="updateparent(this)" /></td></tr> <tr><td>State </td><td> <input id="Radio5" type="radio" Value="{u_state}" onclick="updateparent(this)" /></td></tr> <tr><td>Zip </td><td> <input id="Radio6" type="radio" Value="{u_zip}" onclick="updateparent(this)" /></td></tr> <tr><td colspan="2"><input id="inpbtnFianl" type="button" value="Update" onclick="update();" /></td></tr>

</table>

function update()

{

var FCK = window.opener.FCKeditorAPI.GetInstance('ctl00_cph_FCKeditor1') ; var str = FCK.GetXHTML( true ); if(document.getElementById('Radio1').checked) {

str=str.replace(/{u_mergefield}/g,"{u_fname}")

} else if(document.getElementById('Radio2').checked) {

str=str.replace(/{u_mergefield}/g,"{u_lname}")

} else if(document.getElementById('Radio3').checked) {

str=str.replace(/{u_mergefield}/g,"{u_street}")

} else if(document.getElementById('Radio4').checked) {

str=str.replace(/{u_mergefield}/g,"{u_city}")

} else if(document.getElementById('Radio5').checked) {

str=str.replace(/{u_mergefield}/g,"{u_state}")

} else if(document.getElementById('Radio6').checked) {

str=str.replace(/{u_mergefield}/g,"{u_zip}")

} else {

str=str.replace(/{u_mergefield}/g,"");

} FCK.SetHTML(str); delete str; delete FCK; window.close(); return(false);

}

function updateparent(radiobutton)

{

document.getElementById('Radio1').checked=false; document.getElementById('Radio2').checked=false; document.getElementById('Radio3').checked=false; document.getElementById('Radio4').checked=false; document.getElementById('Radio5').checked=false; document.getElementById('Radio6').checked=false; if(radiobutton.id=="Radio1") {

document.getElementById('Radio1').checked=true;

} else if(radiobutton.id=="Radio2") {

document.getElementById('Radio2').checked=true;

} else if(radiobutton.id=="Radio3") {

document.getElementById('Radio3').checked=true;

} else if(radiobutton.id=="Radio4") {

document.getElementById('Radio4').checked=true;

} else if(radiobutton.id=="Radio5") {

document.getElementById('Radio5').checked=true;

} else if(radiobutton.id=="Radio6") {

document.getElementById('Radio6').checked=true;

} return true;

}


Everything works fine but when it is replacing "{u_mergefield}" to proper string mouse cursor is not coming in editor even if I click on any area then also mouse cursor is not focusing there.

I will soon upload one page (on www.relationshiplist.us) from where you can test this live.

Regards, Mayank Parmar

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy