Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts Validator - 3 textboxes to one error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validator - 3 textboxes to one error" Watch "Struts Validator - 3 textboxes to one error" New topic
Author

Struts Validator - 3 textboxes to one error

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Our application has inputs for a date and the date is required.
The format is 3 textboxes with slashes between the boxes:
<textboxMM>/<textboxdd>/<textboxYYYY>
The date is required. Here's the problem: if any combination of textboxes is left blank we need 1 error to display. If all are blank we do not want 3 errors.
We'll also need to verify if the date is valid, but I think that solving the "required" issue is solved will take care of other problems of fields that depend on one another. :roll:
I am currently reading on Interrelated fields [Husted pg 397] but having trouble piecing the logic together for what I need.


A good workman is known by his tools.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Never mind! I got what I wanted, despite the deprecation AND errata of the code in the book. :roll:
 
 
subject: Struts Validator - 3 textboxes to one error
 
Similar Threads
Date validation in struts....
Bizarro date validation issue
Make fields required when one has a value.
Struts Auto Validation Message in Different Locale Format
Struts2 Datetime Picker focus is not set using javascript