• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Select Multiple Forms in XenForo?


Well-known member
using XenForo_Input::ARRAY_SIMPLE works great for pretty much every type of input array. The problem is that it can't handle select multiple forms. How should I be handling these?

I just want to take all the results and put it in a comma delimited string.


Well-known member
Not sure what you mean by "multiple forms" (as you can submit only one form at a time). Are you looking for a way to filter the values inside an array that you have already filtered via XenForo_Input::ARRAY_SIMPLE ?


Well-known member
I tested this and it worked just fine:

<form action="test.php" method="post">
	<select name="sel1[]" multiple="multiple">
		<option value="Value1">Value 1</option>
		<option value="Value2">Value 2</option>
		<option value="Value3">Value 3</option>
	<input type="submit" />
$request = new Zend_Controller_Request_Http();
$input = new XenForo_Input($request);

$formInput = $input->filterSingle('sel1', XenForo_Input::ARRAY_SIMPLE);

array(2) {
  [0] => string(6) "Value2"
  [1] => string(6) "Value3"


XenForo developer
Staff member
I'd guess that you're not naming the input correctly - it needs the "[]" at the end. This is PHP stuff though, not XF. PHP will only see one value from the list if submitted without the square brackets.