Prototype JS - form elements need names, not just IDs
June 6th, 2008 by Aaron
So, I got stuck on this bug for an hour - so I thought I’d write it down.
I was using prototype js’s serialize command on a form. I was also using a strict xhtml doctype. My form elements had IDs only - and did not have names. Well, serialize kept coming back empty. Turns out that prototype requires there to be names on each of the elements.
UPDATE: Der - according to W3C, the ‘name’ attribute of the ‘form’ tag is deprecated, not the name attribute of the form elements…
*hits head with hand*
Tags: javascript
This entry was posted on Friday, June 6th, 2008 at 4:35 pm and is filed under javascript. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.














