From 26399298164f1fb6eaa4764b543b876766dacf0a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 8 Apr 2009 16:14:17 +0000 Subject: added form_multiselect() to form helper to make it easier to create multiselect fields, and to make it a bit more semantically correct to boot --- system/helpers/form_helper.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'system/helpers') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 0173340c5..4716e4975 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -246,6 +246,31 @@ if ( ! function_exists('form_textarea')) // ------------------------------------------------------------------------ +/** + * Multi-select menu + * + * @access public + * @param string + * @param array + * @param mixed + * @param string + * @return type + */ +if (! function_exists('form_multiselect')) +{ + function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') + { + if ( ! strpos($extra, 'multiple')) + { + $extra .= ' multiple="multiple"'; + } + + return form_dropdown($name, $options, $selected, $extra); + } +} + +// -------------------------------------------------------------------- + /** * Drop-down Menu * -- cgit v1.2.3-24-g4f1b