ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom Value for Select field type

November 01, 2014 6:15pm

Subscribe [2]
  • #1 / Nov 01, 2014 6:15pm

    matchlessamp

    14 posts

    Hi all,
    For the field type Select - is there a way to define custom values. For example, I have a list of US states as the data:

    Alabama
    Alaska
    Arizona
    Arkansas
    California
    etc…

    That’s great but when I display them in a <select> drop down in the front end, how can I display with a custom value:

    <option value="al">Alabama</option>

    Instead of the default

    <option value="Alabama">Alabama</option>
  • #2 / Nov 11, 2014 1:04pm

    Giraffentoast

    152 posts

    Not with the default Select Dropdown field type.

    Install PT Field Pack which comes with customizable checkboxes, dropdowns, radio buttons and more.
    http://devot-ee.com/add-ons/field-pack

    Then, specify options like this:

    al : Alabama
    ak : Alaska
    ...

    If you need more info (or optgroups) here’s the documentation:
    http://docs.pixelandtonic.com/fieldpack/fieldtypes/dropdown/config.html

  • #3 / Nov 11, 2014 1:58pm

    matchlessamp

    14 posts

    Nice. Did not know about that addon. Bonus points for being a free addon.

    Thanks!

  • #4 / Nov 12, 2014 4:23am

    Giraffentoast

    152 posts

    Yeah I think everyone develops a list of must have addons over the years and this is one of them.

    If you’re just getting started you might want to take a look at SingleEntry (single pages), Expresso (wysiwyg), Channel Images (image uploads) and Low Reorder (ordering). They provide features many people consider essential. I’m not affiliated with any of those addons. 😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases