I've done this with LabelTag (http://tinyurl.com/dw0p), originally written
by Erik Hatcher.  It basically adds a * for required fields, as well as a
class="required" to the <label> element.  It also shows the text as red (or
whatever your label.error CSS class says) when their is a server-side
validation error.  Works great for me, I've even modified it to show a
warning icon when database validation errors occur and are looked up from a
database table (custom code that wouldn't apply here).

IMO, there's no reason to have a combined label with a text field (i.e.
<html:text property="lastName" label="userForm.lastName"/> since often
you'll want to put these in a table in separate <td>'s.  

HTH,

Matt

-----Original Message-----
From: Molitor, Stephen L [mailto:[EMAIL PROTECTED]
Sent: Monday, June 09, 2003 5:03 PM
To: 'Struts Users Mailing List'
Subject: Using Validation Framework to control display


> Has anyone tried using the validation framework to control the display of
> the JSP?  For example, if I mark a field as required in validation.xml,
> maybe I could write my own form tag that puts a red asterisk next to the
> edit box.  It might also be nice to configure things like
> enabled/disabled, perhaps by firing off custom rule classes, that check
> security or whatever.  
> 
> Thanks!
> 
> Steve
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to