I don't the client-side validator handles arrays? You should instead allow
server-side validation to take care of complex scenarios.
Paul
On 9/12/07, Matthew Schrader <[EMAIL PROTECTED]> wrote:
>
> Users,
>
> I have been googling like crazy to find a workaround, or fix, to the
> problem of Validator not working properly with nested:iterate fields.
> Below I have included what I am doing for the code incase I have
> something wrong. Please let me know if anyone knows anything.
>
> My field is set up as:
> <field property="menuCategoryDescription"
> indexedListProperty="menuCategories"
> depends="required">
> <arg
> key="WineListForm.MenuCategory.menuCategoryDescription"/>
> </field>
>
> the part of my jsp:
> <nested:iterate property="menuCategories" name="WineListForm"
> type="com.forwardspin.form.dining.MenuCategoryForm"
> indexId="menuCategoryCounter">
> <nested:textarea property="menuCategoryDescription" />
> </nested:iterate>
>
> output to browser:
> <textarea name="menuCategories[0].menuCategoryDescription"></textarea>
> <textarea name="menuCategories[1].menuCategoryDescription"></textarea>
> <textarea name="menuCategories[2].menuCategoryDescription"></textarea>
>
> javascript that is put in browser:
> function validateWineListForm(form) {
> if (bCancel) {
> return true;
> } else {
> var formValidationResult;
> formValidationResult = validateRequired(form) &
> validateMask(form);
> return (formValidationResult == 1);
> }
> }
>
> function WineListForm_required () {
> this.a0 = new Array("menuDisplayDescription", "Wine List Preamble
> is required.", new Function ("varName",
> "this.mask=/
> ^[a-zA-Z0-9\\\'\\,\\.\\-\\[\\]\\{\\}\\:\\;\\?\\/[EMAIL PROTECTED](\\)\\_\\+\\=
> ]*$/; return this[varName];"));
> }
>
> function WineListForm_mask () {
> this.a0 = new Array("menuDisplayDescription", "Wine List Preamble
> is invalid.", new Function ("varName",
> "this.mask=/
> ^[a-zA-Z0-9\\\'\\,\\.\\-\\[\\]\\{\\}\\:\\;\\?\\/[EMAIL PROTECTED](\\)\\_\\+\\=
> ]*$/; return this[varName];"));
> }
>
> I am expecting the _required() function to also have
> menuCategoryDescription 0-2 added to the array. How would this be
> accomplished.
>
> Thank you for any help in advance!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>