Hello
I'm trying to obtain such behavior for my Page_Controller form:
function changeLanguageForm()
{
$arrOptions = array();
$arrCommonLocales = i18n::get_common_languages(true);
foreach( Translatable::get_allowed_locales() as $value )
{
$langName = i18n::get_lang_from_locale($value);
$arrOptions[$value] = $arrCommonLocales[$langName];
}
$action = new FormAction('submitLanguageChange', '', null, null);
$fields = new FieldSet(
new ListboxField('langs', "", $arrOptions, Translatable::get_current_locale())
);
$validator = new RequiredFields('langs');
return new Form($this, 'changeLanguageForm', $fields, $action, $validator);
}
For pure html+js this pretty simple
<select name='myfield' onchange='this.form.submit()'>
<option .... >
...
</select>
</form>
I have no idea how to do that in ss way...