PIXELFLOW :: an intergalactic discourse

Pixelflow

An Intergalactic Discourse

Parsley.js Error Box

I am Error

Recently while attempting to style a Google Form I needed to do some javascript validations before submission. I came across Parsley.js which makes it super easy, they even work with some standard html5 attributes like type=email and required

Radio Head

The default behavior of Parsley.js is to create a div with a list beneath each item with a validation error. This is fine except for a series of check boxes or radio boxes that are each padded by divs.

Magic Divs

Here is a slight modification of the stock Parsley error wrapper to search up the dom until it finds a parent which has an error div.