Christopher,
Here's an example of how I use it with jquery:
<s:field-metadata var="fieldMetadata">
$(function(){applyStripesValidation('${fieldMetadata.formId}',
${fieldMetadata});});
</s:field-metadata>
Make sure you put it in between your <s:form> tags. jquery uses
$(function(){...}); to run code after the document is ready but before
body.onload fires.
In order to use the code above you'll need to have included 3 javascript
files on the page: jquery.js, jquery.validation.js, and
stripes.jquery.validation.js. You can get the latest jquery.js file from
jquery.com. The other two are my own creations. You can get them here:
http://www.tasernetwork.com/javascript/jquery.validation.js
http://www.tasernetwork.com/javascript/stripes.jquery.validation.js
jquery.validation.js is a generic validation plugin for jquery.
stripes.jquery.validation.js is the glue that translates the info from
the field-metadata tag and applies it.
You can see it in action here:
https://www.tasernetwork.com/Order.action
There are a lot of options for validation that you can override.
Hopefully the comments in jquery.validation.js will help with that.
Aaron
Christopher Maier wrote:
> Can someone give an example of the proper use of the FieldMetadata tag?
> I'm starting to use a lot more JavaScript in my application and the brief
> JavaDocs for the class indicate that it may be useful, but I don't get a
> good sense of what the proper way to use it is.
>
> Thanks,
> Chris
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users