Page 1 of 1

Checkbox array

Posted: Sun Mar 11, 2007 9:43 am
by the_last_tamurai
firt of all , the problem not found in forum's search page

how can I catch the form checkbox array in ZF

I make the well known code like this:

Code: Select all

start loop
<input type="checkbox" name="id[]" value="" />
end loop
and in the controller

Code: Select all

$theID[] 	= trim($post->getAlpha('id[]'));
gives me null array

and if I do that /* without the brackets*/

Code: Select all

$theID[] 	= trim($post->getAlpha('id'));
it gives me an error in noTags() function because it expects second argument (parameter ) as string

Posted: Sun Mar 11, 2007 11:30 am
by mentor
>>how can I catch the form checkbox array in ZF
what is ZF?

If getAlpha() assumes parameter as string, then there should some other method for arrays.

Posted: Sun Mar 11, 2007 11:42 am
by aaronhall
From what I found, Zend_Filter::getAlpha() is an input validation function -- why are you validating checkbox input (not that you shouldn't, but what are you trying to accomplish)?

Posted: Sun Mar 11, 2007 1:33 pm
by the_last_tamurai
yes thank you
without filtering it's working now