Forum: Ruby on Rails Ticket #4140? observe_field issue.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hampton (Guest)
on 2006-04-15 08:03
(Received via mailing list)
Take these two basic bits of HTML.


<input id="user_email" name="user[email]" size="30" type="text" value=""
/>
<script type="text/javascript">
//<![CDATA[
new Form.Element.EventObserver('user_email', function(element, value)
{new Ajax.Request('/account/validate_user_email/0',
{asynchronous:true, evalScripts:true, parameters:'user_email=' +
value})})
//]]>
</script>


and

<input id="user_first_name" name="user[first_name]" size="30"
type="text" value="" />
<script type="text/javascript">
//<![CDATA[
new Form.Element.EventObserver('user_first_name', function(element,
value) {new Ajax.Request('/account/validate_user_first_name/0',
{asynchronous:true, evalScripts:true, parameters:'user_first_name=' +
value})})
//]]>
</script>

You would think they are completely identical. Both just a simple
text_field
and then an observe_form done the way that they are prescribed to be
done.
However, the first one does generate a request on change and the second
one
does. No errors are produced by the email version. And, the same effect
is
had on Safari and Firefox 1.5.0.1 on three different platforms.

This also works where "last_name" works and "password" doesn't work and
"login" does work.

Seemingly random as they are all produced by the same code (totally
DRY).

Anybody know why?

I see Ticket #4140
http://dev.rubyonrails.org/ticket/4140
But, doesn't look like anyone is planning on fixing it anytime soon.

Can other people reproduce this? Anyone else found a way around it?

This seems like a pretty serious bug to me.

-hampton.
This topic is locked and can not be replied to.