#1903: Cursor is not coming when string inserted via javascript
-----------------------------+----------------------------------------------
 Reporter:  mayank1711       |        Type:  Bug    
   Status:  new              |    Priority:  Normal 
Milestone:  FCKeditor 2.6    |   Component:  General
  Version:  FCKeditor 2.5.1  |    Keywords:         
-----------------------------+----------------------------------------------
 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

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/1903>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to