Chariot Training Classes

Training Courses

I run Chariot's training and mentoring services. We provide training in AngularJS, HTML5, Spring, Hibernate, Maven, Scala, and more.

Chariot Education Services

Technology

Chariot Emerging Tech

Learn about upcoming technologies and trends from my colleagues at Chariot Solutions.

Resources

Chariot Conferences

Podcasts

« And a fun time was had by all | Main | Interview with Dan Allen on Seam, Part 1 available on the TechCast »
Tuesday
Mar172009

Interesting Plugin for Grails - javascript validation

Anyone who has programmed in Grails realizes the power of the domain-centric design pattern, including validation rules embedded as constraints in the Domain class.

Someone has written a plugin that dynamically generates Apache Commons Validator code on the fly.  It's called the javascript validator plugin and it is enabled in three steps:

Install the plugin:

grails install-plugin javascript-validator

Add to a given form with:

<jv:generateValidation domain="Employee" form="employeeForm">

Set up the form to include validation

<form id="employeeForm" onSubmit="return validateForm(this);" ... >

I'm going to give this a shot. Interesting how simple it could be to add client-side validation without re-architecting your whole code base. This is why Grails rocks!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>