Editor 'stealing' focus on form load

Last post 09-04-2012, 9:18 AM by mjw001. 2 replies.
Sort Posts: Previous Next
  •  09-04-2012, 5:31 AM 74557

    Editor 'stealing' focus on form load

    Hello,

     

    Setting the focus parameter for the editor isn't working for me.

     

    I've used $editor->Focus=false; when I create the editor object, but the editor stil retains it's focus.

     

    Additionally I've tried forcing focus on the form using an image onload method, but with no success.

     

    Is there a fundamental issue with the editor's Focus setting, or am I doing something wrong.

     

    Thanks  

  •  09-04-2012, 8:15 AM 74558 in reply to 74557

    Re: Editor 'stealing' focus on form load

    Hi mjw001,

     

    You can set the focus for other control in the editor load API, like the example below.

     

    1. <?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>  
    2. <html>  
    3.     <head>  
    4.         <title>example</title>  
    5.     </head>  
    6.     <body>  
    7.         <form>  
    8.             <br />  
    9.             <input id="input1" />  
    10.             <?php  
    11.                 $editor=new CuteEditor();  
    12.                 $editor->ID="Editor1";  
    13.                 $editor->Draw();  
    14.                 $editor=null;  
    15.             ?>  
    16.             <script>  
    17.                 function CuteEditor_OnInitialized(editor)  
    18.                 {  
    19.                 setTimeout(setFocus,500);  
    20.                 }  
    21.                 function setFocus()  
    22.                 {  
    23.                 var input1=document.getElementById("input1");  
    24.                 input1.focus();  
    25.                 }  
    26.             </script>  
    27.   
    28.   
    29.         </form>  
    30.     </body>  
    31. </html>  
    Regards,

     

    Ken 

  •  09-04-2012, 9:18 AM 74560 in reply to 74558

    Re: Editor 'stealing' focus on form load

    Thanks Ken - I'll give that a try and let you know how I get on.

     

    Cheers :) 

View as RSS news feed in XML