Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 03:47 PM, beje wrote:
 Hi,
 I have n dinamicaly generated (and identical) forms to fill-in;
 on submition I'd like to validate them by using just a descriptor file
 whitch contains just 1 form (since all are the same).
 
 Is there a way to achieve that ?

Sure, just have the same parameter names. You might even want to set
your descriptor as default descriptor.

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Help with form validation

2001-09-17 Thread Per Kreipke

 Sure, just have the same parameter names. You might even want to set
 your descriptor as default descriptor.

Where would I start to learn about this? Are 'descriptors' a velocity
template thing or a Cocoon2?

Per


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with form validation

2001-09-17 Thread beje


- Original Message -
From: Christian Haul [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 17, 2001 5:40 PM
Subject: Re: Help with form validation


 On 17.Sep.2001 -- 03:47 PM, beje wrote:
  Hi,
  I have n dinamicaly generated (and identical) forms to fill-in;
  on submition I'd like to validate them by using just a descriptor file
  whitch contains just 1 form (since all are the same).
 
  Is there a way to achieve that ?

 Sure, just have the same parameter names. You might even want to set
 your descriptor as default descriptor.

 Chris.

Unfortunately, the fields are numbered like this:
input name=country1 .../
input name=city1 .../
input name=street1 .../

input name=country2 .../
input name=city2 .../
input name=street2 .../

to
input name=countryN .../
input name=cityN .../
input name=streetN .../

And one more thing:
I want to have in the sitemap a general entry for all validation actions,
somehting like:

  map:match pattern=validate-*
!-- first validate whether submitted values are ok --
map:act type=form-validator
  map:parameter name=descriptor
value=context://mysite/mydescriptors/{1}.xml/
  map:parameter name=validate value=  /
map:redirect-to uri=process-{1}.xsp/
/map:act
  /map:match

Is there a wildcard for the validate parameter values ?



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 11:09 AM, Per Kreipke wrote:
  Sure, just have the same parameter names. You might even want to set
  your descriptor as default descriptor.
 
 Where would I start to learn about this? Are 'descriptors' a velocity
 template thing or a Cocoon2?
 
 Per

Please see docs, section Forms  javadocs for the involved classes.

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with form validation

2001-09-17 Thread Christian Haul

On 17.Sep.2001 -- 06:13 PM, beje wrote:
 From: Christian Haul [EMAIL PROTECTED]
  On 17.Sep.2001 -- 03:47 PM, beje wrote:
   Hi,
   I have n dinamicaly generated (and identical) forms to fill-in;
   on submition I'd like to validate them by using just a descriptor file
   whitch contains just 1 form (since all are the same).
  
   Is there a way to achieve that ?
 
  Sure, just have the same parameter names. You might even want to set
  your descriptor as default descriptor.
 
 Unfortunately, the fields are numbered like this:
 input name=country1 .../
 
 input name=country2 .../
 
 to
 input name=countryN .../

If there is no chance of renaming those parameters to country, you
would indeed need to duplicate the entries in your descriptor, there
is no wildcard match operator. Perhaps you could distinguish the
different forms by a hidden value (or the value of the submit
button?), referer URL or target URL? You might still be able to use
the same pipeline in your sitemap.

 And one more thing:
 I want to have in the sitemap a general entry for all validation actions,
 somehting like:
 
   map:match pattern=validate-*
 !-- first validate whether submitted values are ok --
 map:act type=form-validator
   map:parameter name=descriptor
 value=context://mysite/mydescriptors/{1}.xml/

This is OK, {1} is replaced by the match from the pattern matcher.

   map:parameter name=validate value=  /

You could use {1} here as well, perhaps it would be cleaner to switch
to the newer set-based method. See docs, section Forms for this.

 map:redirect-to uri=process-{1}.xsp/

This is no good, since AFAIK redirect is done by sending a redirect
message to the browser -- and the request parameters will be
lost. cocoon: protocoll might solve this (cocoon:/process-{1}.xsp,
don't know off head if this keeps parameter) or a redirect to a
ressource does (sure on this).

 /map:act
   /map:match
 
 Is there a wildcard for the validate parameter values ?

No. But it would be nice to have one, since this way it could be used
to validate input for the database add action when multiple rows are
to be inserted. A patch would be welcome :-)

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with form validation

2001-09-17 Thread Martin Man

On Mon, Sep 17, 2001 at 03:47:54PM +0300, beje wrote:
 Hi,
 I have n dinamicaly generated (and identical) forms to fill-in;
 on submition I'd like to validate them by using just a descriptor file
 whitch contains just 1 form (since all are the same).
 
 Is there a way to achieve that ?

sure there is, just create appropriate validation descriptor and reference to
it with appropriate param for all the URLs your form is alowed to post to, eg


map:match pattern=form1post
map:act type=form-validator
parameter name=descriptor value=mydesc
...

map:match pattern=form2post
map:act type=form-validator
parameter name=descriptor value=mydesc
...

map:match pattern=form3post
map:act type=form-validator
parameter name=descriptor value=mydesc
...


please fill in missing braces, protocols, etc. according to example sitemap
provided along with c2


 Thanks.

rgds,
martin
-- 
---
Only dead fish swims with a stream Malcolm Muggeridge
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]