Prototype.js formElmt.request() and non-valid HTML

Handy and pretty $('myform').request() can be easily broken if you have really broken HTML. For example:

<form id="myform">
  <input />
  <input />

$('myform').serialize() will return empty string for such html. As a result you’ll have ajax request with no parameters, obviously not what you’ve expected. Fix html and everything will work.

Tags: , ,

AddThis Social Bookmark Button

Leave a Reply