Checkboxes....Array

rainfall

New member
OK, I have implemented a custom page where user can choose their known languages...
<input type=checkbox name='lang' value='English'>English
<input type=checkbox name='lang' value='Chinese'>Chinese


If, I checked both boxes, normally the return value should be "English, Chinese".

Now problem in Xenforo.... what should I use? And how to get it to print "English, Chinese"???

$this->_input->filterSingle('lang', XenForo_Input::STRING)
this will only return me "Chinese"

$this->_input->filterSingle('lang', XenForo_Input::ARRAY_SIMPLE)
this will return me "ARRAY" --> array as in text A - R - R - A - Y.
If it is an array object, how do I list it?

and what is this???
$lang = $this->_input->filter(array(
'lang' => array(XenForo_Input::STRING, array('array' => true))
));


Help needed. Thx.
 
It's the name of your checkboxes, they have the same name. Try name="lang_english", and name="lang_chinese" for their names.
 
Top Bottom