On Mon, 2003-09-01 at 02:00, Sonny Sukumar wrote:
> I'm looking for a solution to generate forms for every page of a checkout
> process on an e-commerce site, and so I started looking at Woody. I realize
> it's a work in progress, but I figure if there's a sample of its use in
> Cocoon 2.1 (which I'm using), it might just be able to do the job.
>
> But I'm wondering if I can do field validation with it using regular
> expressions.
Yep you can. The following is taken from the "form1" example of Woody:
<wd:field id="ipaddress" required="true">
<wd:label>Please enter your IP address</wd:label>
<wd:datatype base="string">
<wd:validation>
<wd:regexp
pattern="^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$">
<wd:failmessage>Invalid IP address.</wd:failmessage>
</wd:regexp>
</wd:validation>
</wd:datatype>
</wd:field>
> I looked at this Wiki page and the one it links to on
> validation syntax, and I didn't see anything about it:
>
> http://wiki.cocoondev.org/Wiki.jsp?page=WoodyNotes
It's documented over here:
http://wiki.cocoondev.org/Wiki.jsp?page=WoodyReference
just search for "regexp".
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED] [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]