You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jesse Vitrone <je...@vitalworks.com> on 2003/05/05 20:39:07 UTC

validator question

I'm new to the validator stuff, so there might be an easy way to do this,
but so far I'm missing it.
 
I've got 2 fields on a search screen, an "Other Criteria" and an "Other
Criteria Value".
Other Criteria is a dropdown with stuff like "DOB, SSN, PatientId" etc.
Otehr Criteria Value is the search value of whatever criteria type they
picked from the dropdown.
 
I'd like to use the validator to check the dropdown value, and if it's DOB,
validate the value like it's a date, or if the dropdown is SSN, validate
like it's an ssn, etc.
 
How do I set up my xml validation rules to reflect this logic?
 
Thanks in advance,
    Jesse
 

RE: validator question

Posted by Mark Galbreath <ma...@qat.com>.
Validator doesn't care if you have dropdowns, it's simply looking at the
value the page object passes it in the request.  Just test for the property
name you used in the JSP and write a regular expression applicable to that
field's validation parameters.

Mark

-----Original Message-----
From: Jesse Vitrone [mailto:jessevitrone@vitalworks.com] 
Sent: Monday, May 05, 2003 2:39 PM
To: struts-user@jakarta.apache.org
Subject: validator question


I'm new to the validator stuff, so there might be an easy way to do this,
but so far I'm missing it.
 
I've got 2 fields on a search screen, an "Other Criteria" and an "Other
Criteria Value". Other Criteria is a dropdown with stuff like "DOB, SSN,
PatientId" etc. Otehr Criteria Value is the search value of whatever
criteria type they picked from the dropdown.
 
I'd like to use the validator to check the dropdown value, and if it's DOB,
validate the value like it's a date, or if the dropdown is SSN, validate
like it's an ssn, etc.
 
How do I set up my xml validation rules to reflect this logic?
 
Thanks in advance,
    Jesse
 



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org