Hi.

Autocompleter constructor just uses $() function for lookup element.
So it's OK to pass element itself as first parameter.

    createEditField: function() {
      this._createEditField();
      new Autocompleter.Local(this.editField, ...);
    }

lskatz <[EMAIL PROTECTED]> wrote:
> Ok I think that the major problem I am having now is that the editor
> field does not have an id, and I need an id for the autocompleter.  My
> code is below... any help please?
>
> My javascript error (in firefox) is
> Error: this.element has no properties
> Source File: /javascript/scriptaculous/controls.js
> Line: 59
>
>         // add in the inplaceeditor for the name field
>         var editor=new Ajax.InPlaceEditor('name' + hoursId,'changeHour.php',{
>                 okButton:false,
>                 submitOnBlur:true,
>                 formId:'ajaxForm',
>                 callback:function(form,value){
>                         var request="hoursId=" + hoursId + 
> "&which=name&username=" + value;
>                         return request;
>                 },
>         });
>     Object.extend(editor, {
>       _createEditField: editor.createEditField,
>       createEditField: function() {
>         this._createEditField();
>                 new Autocompleter.Local(this.editField.id,'name' + hoursId,
> 'employeeSuggestion.php',{
>                                                                 'minChars':1,
>                                                            });
>
>       }
>     });


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to