AJax.InPlaceEditor - Controlling initial text selection

I want to use in-place editing, but do not want any text to be selected
when the user invokes the in-place editor. I would like the cursor to
be placed at the end of the text when the in-place editor appears
instead of having all of the text automatically selected. Is this


I discovered that adding the following to application.js works:

// Manipulates the caret position in a 'textarea'.
// It creates a selection if selStart and selEnd are not equal.
// To place the caret at the beginning of text:
// "setSelRange(element, 0, 0);"
function setSelRange(inputEl, selStart, selEnd)
  if (inputEl.setSelectionRange)
    inputEl.setSelectionRange(selStart, selEnd);
  else if (inputEl.createTextRange)
    var range = inputEl.createTextRange();
    range.moveEnd('character', selEnd);
    range.moveStart('character', selStart);


// Extend Ajax.InPlaceEditor so that it does not automatically select
// text when the im-place editor is invoked.
Object.extend(Ajax.InPlaceEditor.prototype, {
    onLoadedExternalText: function(transport) {
        this.editField.disabled = false;
        this.editField.value = transport.responseText;

        setSelRange(this.editField, this.editField.value.length,