You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Er...@swissinfo.ch on 2004/03/29 16:38:02 UTC

[Validator] How to access the value of a field in the XML

Hi

I'm trying to access the value of the field I'm validating. That is, I'm
validating an e-mail address and would like the validated e-mail address to
appear in the error message as first parameter.

I tried
         <field property="email" depends="email">
         	   <arg0 key="${email}" resource="false"/>
         </field>

or

         <field property="email" depends="email">
         	   <arg0 key="${var:email}" resource="false"/>
         </field>

but they both don't work. Haven't found an example, but perhaps it's there -
in that case: Sorry!  :-)

Eric


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


Re: [Validator] How to access the value of a field in the XML

Posted by David Graham <gr...@yahoo.com>.
I don't think it's possible to reference the current field value although
that might be a nice addition.  I've only constructed messages from
properties files and hardcoded variables like maxlength.

David

--- Eric.Lewis@swissinfo.ch wrote:
> Hi
> 
> I'm trying to access the value of the field I'm validating. That is, I'm
> validating an e-mail address and would like the validated e-mail address
> to
> appear in the error message as first parameter.
> 
> I tried
>          <field property="email" depends="email">
>          	   <arg0 key="${email}" resource="false"/>
>          </field>
> 
> or
> 
>          <field property="email" depends="email">
>          	   <arg0 key="${var:email}" resource="false"/>
>          </field>
> 
> but they both don't work. Haven't found an example, but perhaps it's
> there -
> in that case: Sorry!  :-)
> 
> Eric
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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