Welcome Guest, Not a member yet? Register   Sign In
Automated US State dropdown
#1

[eluser]Iverson[/eluser]
I got tired of recreating a dropdown so I made a view that I can just include in my application. You can use the following variables:

Code:
<?php

// Optional variables
$config['name'] = 'element_name';        // sets the name attribute to "element_name"
$config['id'] = 'element_id';            // if not specified, the element will have the same name and id
$config['class'] = 'fancy_select';       // set the class attribute to 'fancy_select'

$config['multiple'] = TRUE;              // makes the menu a multiple select type
$config['selected']['XX'] = ' selected="selected"';        // sets "XX" to be selected
$config['selected']['XY'] = ' selected="selected"';        // sets "XY" to be selected. Also, the menu becomes a multiple select. No need to use $config['multiple']
$config['size'] = 25;                    // Sets the multiple select menu size


echo $this->load->view('state_dropdown', $config, TRUE);

This can easily be ported into a plugin or helper but I just didn't feel like it at the current moment Smile


Messages In This Thread
Automated US State dropdown - by El Forum - 04-30-2009, 02:45 PM
Automated US State dropdown - by El Forum - 02-18-2010, 08:33 PM
Automated US State dropdown - by El Forum - 02-19-2010, 06:48 AM
Automated US State dropdown - by El Forum - 03-09-2010, 07:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB