# Observe\_field Firefox error

**URL:** <https://www.ruby-forum.com/t/observe-field-firefox-error/112258>\
**Category:** Rails\
**Created:** [August 16, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/observe-field-firefox-error/112258 "2007-08-16T21:41:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [August 16, 2007, 9:41pm UTC](https://www.ruby-forum.com/t/observe-field-firefox-error/112258/1 "2007-08-16T21:41:49Z")

</div>

I’ve been having some problems in Firefox with observe\_field.  
Everything seems to work fine in IE, however when I try to observe a  
select box nothing seems to happen in firefox. I downloaded FireBug to  
investigate, and an error in prototype.js is raised

2751 getValue: function(element) {  
2752 element = $(element);  
2753 var method = element.tagName.toLowerCase();  
2754 return Form.Element.Serializersmethod;  
2755 },

Below is the error displayed in FireBug:

element has no properties  
getValue(null)prototype.js (line 2753)  
getValue()prototype.js (line 2875)  
initialize(“paragraph[letter\_type\_id]”, 0.25, function())prototype.js  
(line 2853)  
create()prototype.js (line 37)

var method = element.tagName.toLowerCase();

I’ve read that this may have to do with how DOM is handled in IE vs  
Firefox. Anyone have any suggestions?

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [August 17, 2007, 1:20am UTC](https://www.ruby-forum.com/t/observe-field-firefox-error/112258/2 "2007-08-17T01:20:14Z")

</div>

It is saying that element is a null variable meaning that the string  
element in line 2752 “$(element)” is not a valid id.  
please post the rhtml template including the observe\_field code and the  
html element being observed

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [August 17, 2007, 4:18pm UTC](https://www.ruby-forum.com/t/observe-field-firefox-error/112258/3 "2007-08-17T16:18:01Z")

</div>

Keynan P. wrote:

> It is saying that element is a null variable meaning that the string  
> element in line 2752 “$(element)” is not a valid id.  
> please post the rhtml template including the observe\_field code and the  
> html element being observed

Your right. Thanks Keynan, I realized that I had only given the select  
field a ‘name’ and not an ‘id’. I guess IE works with just a name, but  
firefox must use the id to retrieve the element.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![chrismalek](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/6de8d8/32.png) [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Post date:** [November 9, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/observe-field-firefox-error/112258/4 "2007-11-09T23:06:42Z")

</div>

I have the same problem, but i have a name and a id

the html source

Choisissez votre Pays FRANCE

On Aug 17, 10:18 am, Chris M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
