You do not want to alter the source code of scriptaculous, or at least
I would not recommend it since whenever you update your library to a
newer version you will lose those changes. You need to *extend* those
classes/modules in a separate JS file that is included after the
controls.js file is included.

I am not able to spend a lot of time helping you with code, but I can
offer some UNTESTED stuff. Note that I am using Function#wrap
( and Object#extend
( to help. Typically this
code would go in your main application JS file or a overrides JS file.

Autocompleter.Base.prototype.baseInitialize =
  var args = $A(arguments), proceed = args.shift();

  // call the original baseInitialize method with any passed in arguments
  proceed.apply(this, args);
  // attach a mouseup listener, a brute-force way to observe for a
mouse copy/paste event
  Event.observe(this.element, 'mouseup',

  getToken: function() {
    var bounds = this.getTokenBounds();
    // same code as the original getToken method except we're not
calling strip() on the string
    return this.element.value.substring(bounds[0], bounds[1]);

On Fri, Sep 12, 2008 at 12:50 PM, Jack D <[EMAIL PROTECTED]> wrote:
>    Will there be any impact on any other part of the autocompleter? I mean
> what would be the side efftect of the above 2 soluns?

The side effect of the additional observer is it will fire when *ANY*
mouseup event is fired whenever the autocompleter input control has

The side effect of overriding the getToken method is that literally
whatever is input into the autocompleter control will be passed
through to the server. Leading spaces, trailing spaces, etc...


You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to