BabelKit Multilanguage Code Select PHP Demo

BabelKit - Interface to a universal multilingual code table.

The codified values stored in database fields are not language sensitive. However, web pages and other documents often need to display the code descriptions in various languages.

BabelKit makes this a snap to program. You can see the PHP method calls to BabelKit that produce these multilingual HTML select elements.

This page shows off the BabelKit code select functions. Select another language for the code description display. Select various combinations of countries and months then click [Test BabelKit] at the bottom to see the selected codes:

VariableCode(s)
$display_lang''
$mycurrency''
day''
country[]
month[]

Have fun!

Select another display language!

Specify the variable name as 'display_lang'.
Pass in the native language as the default value.
Submit form when selection changes

print $babelkit->select('code_lang', $display_lang, array(
                         'var_name' => 'display_lang',
                         'default'  => $babelkit->native,
                         'options'  => 'onchange="submit()"'
));
    
$display_lang is '':

Select a currency.

Pass in a specific code value.

print $babelkit->select('currency', $display_lang, array(
                         'value' => $mycurrency
));
    
$mycurrency is '':

Radiobox for days of the week.

Constrain choices to the weekdays (1-5).
A blank separator displays them all on one line.

print $babelkit->radio('day', $display_lang, array(
                        'subset' => array(1, 2, 3, 4, 5),
                        'sep'    => ''
));
    
'day' is ''.

MondayTuesdayWednesdayThursdayFriday

Select multiple countries.

Specify a window scrolling size of 10.

Experiment with Ctrl-click and Shift-click.
to select multiple countries.

print $babelkit->multiple('country', $display_lang, array(
                           'size' => 10
));
    
'country' contains []:

Checkbox for multiple month selections.

Simple no frills method call.

print $babelkit->checkbox('month', $display_lang);
    
'month' contains []:

January
February
March
April
May
June
July
August
September
October
November
December

<-- Click here to see the updated PHP variables!