cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Mata <manuel_mata_ru...@yahoo.es>
Subject Multiple regular expresion validation
Date Tue, 27 Feb 2007 16:52:06 GMT
Hi all. I have this widget definition and a surely
with easy solution problem, but i dont know how.

<fd:field id="phone" required="true">
 <fd:label><i18n:text key="label.phone"/>:</fd:label>
 <fd:datatype base="string"/>
 <fd:validation>
  <fd:length max="12"/>
  <fd:regexp pattern="[0-9](9)"/>
  <fd:regexp pattern="[0-9](3) [0-9](3) [0-9](3)"/>
  <fd:regexp pattern="[0-9](3) [0-9](2) [0-9](2)
[0-9](2)"/>
 </fd:validation>
</fd:field>

What i need is to accept phone numbers like:

XXXXXXXXX
XXX XXX XXX
XXX XX XX XX

but the form only validates the first one. How can i
do that accept anyone of the three ?.

Another question. Is it possible to define this widget
in any file like "phone.widget.xml" and reuse it in
forms with a strategy like xi:include ?

Thx for your time.


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message