Interesting Plugin for Grails - javascript validation
Tuesday, March 17, 2009 at 6:09AM 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!
chariot-news,
grails,
plugins in
Groovy/Grails 


Reader Comments