Does your field have the ID attribute set to 'zip'? If it's working in
IE, that's a strong bet that it doesn't, but that it does have the
name set to 'zip'. Element.getValue() and $F() need a valid (properly-
formed and unique on the page) ID for their magic to happen. If you
can't add an ID to the input, you can pass a more elaborate selector
like document.forms[0].zip (without surrounding quotes, naturally)
into the function. $() will work from an object or an ID, but it won't
work with just a name, except in IE, which has a serious bug in that
corner.
Walter
On Jun 13, 2011, at 11:03 AM, Phil Petree wrote:
In Firefox 3.6.16
I have an Event.observe('ajzip', 'keyup', cities); and the first
line of which tests to see if I have 5 digits entered in the zip
code field and if so it makes an ajax call... works great in IE.
When I press and release a key, my function "cities" gets called, it
tests the length of zip and then jumps into prototype.js on line
4064 where it attempts to execute the following lines:
1) getValue: function(element) {
2) element = $(element);
3) var method = element.tagName.toLowerCase();
4) return Form.Element.Serializers[method](element);
When line 1 gets called, element is set to "zip"; line 2 returns
null and line 3 throws an "Element is null" error!
Like I said, this all works fine in IE. Any ideas?
--
You received this message because you are subscribed to the Google
Groups "Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
.
To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.