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,
});
}
});
On Jul 15, 2:39 pm, lskatz <[EMAIL PROTECTED]> wrote:
> Thanks a million. This looks like it's about to work.
>
> On Jul 15, 5:13 am, Takanori Ishikawa <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
>
> > InPlaceEditor invoke createEditField method for creating its textField
> > element.
> > So you can instantiate InPlaceEditor and override the
> > createEditField() method
> > with something like this:
>
> > var editor = new Ajax.InPlaceEditor('editme', '#');
>
> > Object.extend(editor, {
> > _createEditField: editor.createEditField,
> > createEditField: function() {
> > this._createEditField();
> > new Autocompleter.Local(this.editField, 'band_list', ['ABBA',
> > 'AC/DC', 'Aerosmith', 'America'], {});
> > }
> > });
>
> > lskatz <[EMAIL PROTECTED]> wrote:
> > > Ok maybe this is too hard... is there some kind of parameter/function
> > > that I can put into the inplaceeditor that is activated when the
> > > inplaceeditor is created? If that is the case, then I can create the
> > > autocompleter when the inplaceeditor is made. Thanks.
>
> > > On Jul 11, 10:45 am, lskatz <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
> > > > Is there an easy way to get an inplaceeditor with an autocompleter?
> > > > I want to be able to click some text and have the inplaceeditor pop
> > > > up, but also have the autocompleter on it.
> > > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---