Craig Angus
Craig Angus

Reputation: 23178

How can I set the focus inside the Yahoo Rich Text Editor

I have a an HTML form which contains the YAHOO rich text editor on it.

When I display the form I want the YAHOO editor to have focus so that the cursor is ready to accept input without the user having to click on it or tab into it

Upvotes: 2

Views: 714

Answers (3)

Benry
Benry

Reputation: 5298

I got this from the documenation over at the YUI library. Specifically at a sample titled Editor - Basic Buttons

var myEditor = new YAHOO.widget.Editor('editor', {focusAtStart:true});
myEditor.render();

The key here is the the "focusAtStart" attribute as part of the optional attributes object

Upvotes: 1

pmg
pmg

Reputation: 108978

Like roenving, I have never used the YAHOO rich text editor, but it should work with the window.onload event.

Let's say you specified id="yahoo_text_editor" for your YAHOO rich text editor.
Then, do

<body onload="document.getElementById('yahoo_text_editor').focus()">

Hope this helps.

Upvotes: 0

roenving
roenving

Reputation: 2636

I haven't employed the YAHOO rich text editor, but wouldn't it work, if you use a window.onload event ?-)

Upvotes: 0

Related Questions