[FE-discuss] multiple input fields validation

Top Page
Author: Marcin Stępnicki
Date:  
To: formencode-discuss
Subject: [FE-discuss] multiple input fields validation
Hello.

I've got the following scenario:

User has to fill in some fields, but I don't know how many of them
will be necessary. Let's say:

1. Child #1 birth date: ....... (+)
---------------------------------------------
2. Child #2 birth date: .......

After clicking (+) a simple Javascript/jQuery function adds another
input field to DOM :

<input id="finish_date-1" type="text" value="" style="width: 80px;"
name="finish_date"/>
<input id="finish_date-2" type="text" value="" style="width: 80px;"
name="finish_date"/>
etc.

Unfortunately, I can't find a way to validate all fields
simultaneously. Here's a small snippet with my failed attempts:

http://pastebin.com/f12b9ea26

Just a thought: I can simply use different names for different input
fields and then perhaps somehow modify the validation schema depending
on number of fields added by the user, but it seems ugly.

Is there any hope for me? ;-)

Regards,
Marcin

------------------------------------------------------------------------------
_______________________________________________
FormEncode-discuss mailing list
FormEncode-discuss@???
https://lists.sourceforge.net/lists/listinfo/formencode-discuss