by osborne » Thu Nov 12, 2009 6:59 pm
Thanks, Matt. I know FormValidatorCustom pretty well---I've used it a lot---and I don't think it can do what I want. I'm not sure about FormValidatorArrayCustom. The versions of OJS that I have don't include it---I just added it from your CVS---so I can't easily grep to see how it's used. (I found an instance of its use, but that didn't answer my question. I thought Google should have gone through your CVS, but it doesn't seem that it has.)
I have a form like this:
Item 1
Name:
Number:
Item 2
Name:
Number:
Item 3
Name:
Number:
and so on. I'm collecting the user input in arrays. The input is valid if, for each item, *either* there is both a name and a number *or* there is neither a name nor a number. It's easy to use FormValidatorCustom to report an error under the right circumstances, but I don't see how to get the offending fields to be highlighted (i.e. the name field for an item where the user has entered only a number, and the number field for an item where the user has entered only a name, but no other fields). Seems like FormValidatorArrayCustom might be able to do it, but so far I haven't been able to find how. The problem is that while it can work with all the name fields, or all the number fields, I don't see how to get it to work with both.
Martin J. Osborne