Aparently, Safari treats the 'length' property as a variable, but does not reset it's value.
The first time, it will count the number of elements correctly (in this example 3 + 1 = 4)
The second time it does not reset the previous count and adds the new number of items to the previous time it counted.
In the example above, Safari counts 3 radio buttons the first time. After adding 1 radiobutton, it counts 4 radiobuttons, but
adds that to the previously counted 3
(resulting in 7) the second time.. 7 + 5 = 12, .. 12 + 6 = 18, 18 + 7 = 25 and so on, and so on..
Update february 16, 2004: Dave Hyatt of Surfin' Safari (http://weblogs.mozillazine.org/hyatt/index.html)
notes;
"I have fixed the count problem. That was a cool bug. :) We're looking into the keypress problem too."
Safari seems to treat key-press events a bit different than other browsers.
Although Safari's approach is (in my opinion) more logical, it causes some problems on sites where an 'autotab' is put on a field.
I discovered this problem on a Dutch banking-site (www.postbankzakelijk.nl) where it caused my mother a lot of headaches
key-press -> the characters are counted -> the character is entered in the textfieldOther browsers (IE, Mozilla):
key-press -> enter the character in the textfield -> the characters are counted
I hope this information is useful for anybody.
You can always contact me by email:
safariproblem_PLACE_'AT'_HERE_gone.nl