# Bug in Script.aculo.us' Ajax.InPlaceEditor?

**URL:** <https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985>\
**Category:** Rails\
**Created:** [January 22, 2006, 6:15pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985 "2006-01-22T18:15:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 6:15pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/1 "2006-01-22T18:15:42Z")

</div>

Guys,

I am likely going to submit this as a bug, but wanted to see if anyone  
else is experiencing it. I’m trying to use an Ajax.InPlaceEditor. In  
firefox, it works great, but in IE, it adds two form elements when  
clicked instead of one.

In other words, you have two text fields, two ok buttons, and two cancel  
links after clicking an element to be edited.

This even happens when performing the online demo, found here:

[http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor](http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor)

Can anyone confirm or deny that they’re experiencing similar behavior?

Thanks, as always, for the help!

John

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/2 "2006-01-22T19:05:46Z")

</div>

On Jan 22, 2006, at 9:15 AM, John W. wrote:

> In other words, you have two text fields, two ok buttons, and two  
> cancel  
> links after clicking an element to be edited.
> 
> This even happens when performing the online demo, found here:
> 
> [http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor](http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor)

Same behavior in Safari 2.0.3 (417.8)

–  
– Tom M.

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 7:19pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/3 "2006-01-22T19:19:53Z")

</div>

Tom M. wrote:

> On Jan 22, 2006, at 9:15 AM, John W. wrote:
> 
> > In other words, you have two text fields, two ok buttons, and two  
> > cancel  
> > links after clicking an element to be edited.
> > 
> > This even happens when performing the online demo, found here:
> > 
> > [http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor](http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor)
> 
> Same behavior in Safari 2.0.3 (417.8)
> 
> –  
> – Tom M.

I see that behavior on the demo page using Maxthon (which is basically  
IE with a spiffy front-end).

\_Kevin

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 8:34pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/4 "2006-01-22T20:34:30Z")

</div>

Yep, I see the same thing in IE6 on win2k with all the latest patches.

b

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 9:31pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/5 "2006-01-22T21:31:48Z")

</div>

Thanks guys. It almost looks like a timing issue…I can insert alerts  
into the class in controls.js and the problem goes away…I suspect  
because the alert slow it down enough to fix the problem.

If only setTimeout allowed maintaining of scope, I’d explore this  
further.

Thanks!  
John

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 22, 2006, 9:03pm UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/6 "2006-01-22T21:03:14Z")

</div>

Using Safari Version 2.0.3 (417.8), I see the same behavior on that demo  
page. However, in an app of mine which uses InPlaceEditor, it works as  
expected.

I manually updated our app to the most recent Prototype(1.4.0) and  
scriptaculous(1.5.1)…

---

<div class="post-metadata">

**Author:** ![princenamor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c0e974/32.png) [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Post date:** [January 23, 2006, 2:21am UTC](https://www.ruby-forum.com/t/bug-in-script-aculo-us-ajax-inplaceeditor/52985/7 "2006-01-23T02:21:20Z")

</div>

Sigh…what fun.

I resolved my issue. It had to do with an accidental typo in the script  
that generates my fields, so that there was a duplicate of two sections  
of about 20 elements. Each of those elements were duplicated, and their  
ids were duplicated. This explains it pretty well.

The reason the demo page at [script.aculo.us](http://script.aculo.us) demonstrates the same  
behavior is that they use the id “editme” in numerous page sections.

Apparently Firefox ignores this, IE and Safari do not.

Thanks,  
John
