My Blog

contains PHP and other web related content. (Sometimes there are some off topic things - don't freak out!)

Prototype JS – form elements need names, not just IDs

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:

One Response to “Prototype JS – form elements need names, not just IDs”

  1. Awesome post. I’ve been checking out the site a lot lately, looks great! Subscribing to your feed..

Leave a Reply

  • twitter loader

Follow me on twitter: @aaronsaray

The views on this website are my own and do not reflect the opinions of my employer or clients.
Creative Commons License Home | Open Source | Book | Music | Art | Bio | Resume | Contact
My Baby