Mar. 03 2013

What’s New with Foul 2.0

I created Foul out of frustration over the lack of an easy, stand-alone form validation library. While I’m not a fan of creating new languages to solve something a preexisting one can already achieve in this case I thought the ease and speed of creating validations offset the work of learning a new language.

Foul 2 is the first major re-write of the original Foul library. I wanted to make the language more simple and less rote.

Some new features include inline HTML error reporting with the ability to style them via CSS, testing against numeric and string literals and the ability to create test groups.

Download Foul 2.0 here.

3 Responses to “What’s New with Foul 2.0”

  1. Derek Says:

    Hey is there an easy way to modify the script to work with ids instead of names?

  2. benglish Says:

    If you edit line 141 in foul2.js and change “form ?” to “false ?” it will use the ID of the form fields. It’s it bit of a hack but will work in a pinch.

  3. Derek Says:

    Thanks Benglish! I got it working with IDs ok, but I can’t seem to get anything to verify if I use the length modifier. For example,

    foul.when(‘~personnelnumber:length~ is < 9','A valid personnel number is required.');

    returns as valid no matter if personnelnumber consists of 2 characters, or a million. Similarly,

    foul.when('~personnelnumber:length~ is between 9 10','A valid personnel number is required.');

    does the exact same thing. It always validates even when it's not valid. All other validations work correctly (so far).

Leave a Reply

3 Comments »




  • I Killed WarMECH

    Morgue File

    Electronic Frontier Foundation

    Librarian Chick, a collection of links to the best of the Internet's FREE resources for those with big brains and small pocketbooks!



    Flying Spaghetti Monster

    The Out Campaign: Scarlet Letter of Atheism