I'm looking for a nice way to change an input field's text label to red when there is an ActionMessage/ActionError generated by Validator. I'm handling the error message where global messages are displayed and I want to take the property names from the ActionMessage and change the label text to red based on the property name. I'm thinking fetching the labels' for attr (property) and get from the ActionMessage map. If it exists,then change the color.
Or there may be a slicker way of doing it. I'm open to suggestions.
Joined: Apr 03, 2003
The problem with this approach or even just passing in a String of the properties that are in error is knowing how to get that info in to the request object. Does Validator put an object in the request ?
The link that Nyanas had mentioned does not seem to be working. Can someone provide me a solution to highlight the Label for example "Your Name" (refer previous messages by Jeff) to red on error. I am using bean:message to display the label on the page. Thanks