commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maitri <>
Subject commons-validator: Javascript error using validwhen
Date Wed, 19 Dec 2007 16:29:41 GMT

Hi to everyone! 
I'm getting some problem using validwhen.. 

Below is an xml fragment of the declaration in validation.xml:
<field property="executionDate" depends="validwhen,date">
				<msg name="date" key="" />
				<msg name="validwhen" key="errors.required" />
				<arg0 key=""/>
					<var-value>((type != '1') or (*this* != null))</var-value>

It produces a javascript function like this:
function DateValidations () { 
     this.aa = new Array("executionDate", "Fecha de ejecuciĆ³n no es una
fecha.", new Function ("varName", "this.datePatternStrict='dd/MM/yyyy';
this.test='((type != '1') or (*this* != null))';  return this[varName];"));

And it is giving me an error here: this.test='((type != '1') 
If I put double quoted it shows a javascript error to, and if I add the  \"
the javascript created shows \\"

The Validator section of the Struts documentation says String literals in
single or double quotes are legal values in the expression. 
What am I missing???
Yhanks in advance...
View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message