commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maitri <maitri_s...@hotmail.com>
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="errors.date" />
				<msg name="validwhen" key="errors.required" />
				
				<arg0 key="execution.date"/>
						
				<var>
					<var-name>datePatternStrict</var-name>
					<var-value>dd/MM/yyyy</var-value>
				</var>
				<var>
					<var-name>test</var-name>
					<var-value>((type != '1') or (*this* != null))</var-value>
				</var>
			</field>

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: http://www.nabble.com/commons-validator%3A-Javascript-error-using-validwhen-tp14420327p14420327.html
Sent from the Commons - User mailing list archive at Nabble.com.


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


Mime
View raw message