Hi Justin,
    Sorry for my previous quick reply. The code works fine. There was
semicolon which is not required. Code works fine although I still have a

    When I pasted text using mouse, it didn't display the hints. I've to at
least click once in the text box to get the hint.

     Will that be fixed? Mostly users try to paste it in the text box & wait
for the results....Is this possible?


On Fri, Sep 12, 2008 at 12:57 PM, Jack D <[EMAIL PROTECTED]> wrote:

>  Hi Justin,
>     Thanks for the prompt solution. I copied the below code in a file
> called abc.js & included it in the calling program. But, I'm getting error
> in IE 6. It works fine in Firefox.
>     It gives me error in IE: Expected identifier, string or numer
>     Can you please help me?
> Thanks!
>   On Fri, Sep 12, 2008 at 12:10 PM, Justin Perkins <
>> 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
>> (http://prototypejs.org/api/function/wrap) and Object#extend
>> (http://prototypejs.org/api/object/extend) to help. Typically this
>> code would go in your main application JS file or a overrides JS file.
>> Autocompleter.Base.prototype.baseInitialize =
>> Autocompleter.Base.prototype.baseInitialize.wrap(function(){
>>  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',
>> this.onKeyPress.bindAsEventListener(this));
>> });
>> Autocompleter.Base.addMethods({
>>  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
>> focus.
>> 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...
>> -justin
>> >>

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to