Hey Brendon,

I'm not sure about how you can prevent this, but two bits of advice:

(a) your sample code features duplicate id= attributes.  That's just not 
good: it's likely to come back and bite your ankle should you need to 
access one of these elements by id=, for instance.

(b) It's not generally a good idea to rely on serialization order. 
Although the HTML 4.01 spec mandates that fields are indeed serialized 
in document order, I see no provision for accomodating later, 
scripting-based ordering change (which does seem like the logical thing 
to do, I'll grant).

Finally, in your example, I think the data are submitted in document 
order: you're just relying on the indices in your names, which of course 
you don't update.  No matter how ordered the fields are:

   mookie[1]=blah&mookie[0]=foo
   mookie[0]=foo&mookie[1]=blah

will both de-serialize server-side to mookie == ['foo', 'blah']

If you don't want that, you'd need to remove explicit indices (leaving 
only "mookie[]" as a shared field name) and assume you always go from 
zero upwards…

'HTH

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to