Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jakarta struts and validation

Status
Not open for further replies.

ew0kian

Programmer
Aug 7, 2004
1
US
I have a working validatorform form that uses the struts validation framework (mostly handled through xml files).

but i want it to instead of just saying "email is invalid"... i want it to also highlight the text infront of the field in red. any ideas as to the best way to implement this?

My code can be seen at this experts exchange thread:

THANKS!
 
Just set a property in the request/session/ActionForm to true that shows the validation failed. Then wrap your html in a <logic:equals> tag that tells it which style's to use.

Code:
<logic:equals property="validationFailed" value="true">
<p color=red>Test</p>
</logic:equals>
<logic:notEquals property="validationFailed" value="true">
<p>Test</p>
</logic:notEquals>

I would recommend using the Actionform so that you can instantiate the value to something, and then you don't have to worry about the <logic:exists> checks becuase the property will be there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top