Aaron Saray

open source programmer,
web developer

entrepreneur, author
and musician

My Blog

contains PHP, Web and business/entrepreneurial related content. Please join in the conversation!

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*

This entry was posted in javascript and tagged . Bookmark the permalink.

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

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>