struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ameer Ahmed <>
Subject Validator Order with custom validations
Date Fri, 20 Feb 2004 17:40:59 GMT
Hi All, 
I have the following setup for validating certain fields. I have written a custom validator
for validating certain date logic.
<validator name="xxxDates"
<field property="presentationStart"  depends="required,date,xxxDates">
             <arg0 key="presentationStart"/>
  <field property="presentationEnd"  depends="required,date,xxxDates">
             <arg0 key="presentationEnd"/>
and on my jsp
<html:form  action="/propertyOffer" onsubmit="return validatePropertyFormBean(this);">
<html:text property="presentationStart" size="20"  />
<html:text property="presentationEnd" size="20"  />

<html:javascript formName="propertyFormBean"/>
Ok this works like a charm, if i submit the form without any values i get a javascript popup
alert saying presentationStart is required, presentationEnd is required. However, when i put
a value in presentationStart and submit i dont get a js popup for presentationEnd, however
the validation runs and i get a server side error saying presentationEnd is required. So my
question is when you put in a custom validator for one of the fields why doesnt it evaluate
the required validation (javascript) for the 2nd field? is this a bug? Any help would be appreciated.
If i remove my custom validator(xxxDates) from both fields, the js required pop up runs smoothly
for the 2nd field if the first one is not null. So to recap when you put in a custom validator
for one of the fields the validator doesn't run through the rest of the fields until it has
performed the serverside validation on the custom validator for the 1st field. I am using
struts 1.1 with validator as plug-in

Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message