Re: passing array from quickform for validation

From: Date: Fri, 22 Dec 2006 16:07:25 +0000
Subject: Re: passing array from quickform for validation
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26177@lists.php.net to get a copy of this message
On 12/22/06, rav k <rav220@hotmail.com> wrote:
Hi I've got checkboxes and textareas which I need to validate. For each checkbox there is a textarea. When I validate I am calling my own function which is supposed to get the checkbox/textarea group and validate it. According to the documentation quickform will pass the group elements as an array. When I do print_r($vars) [where $vars is supposed to be the array] I get something like '1xxx2yyy' That is: checkbox1 ticked and textarea1 contents xxx, checkbox2 ticked and textarea2 contenx yyy etc. That doesn't seem to be an array or else I am doing something wrong. How can I put this into something where for each checkbox ticked I can check the length of the textarea string and make sure it is not over 200 - that's all I want to do. Any ideas?
I'm not sure about the specific thing you're talking about, but a formRule is usually the easiest way to deal with complex validation. -- Justin Patrin

« previous php.pear.general (#26177) next »