- // Timezone selection form
- $timezoneForm = 'Continent:';
- $timezoneForm .= '<select name="continent" id="continent" onChange="onChangecontinent();">';
- $timezoneForm .= $continentsHtml.'</select>';
- $timezoneForm .= ' City:';
- $timezoneForm .= '<select name="city" id="city">'.$cities[$pcontinent].'</select><br />';
-
- // Javascript handler - updates the city list when the user selects a continent
- $timezoneJs = '<script>';
- $timezoneJs .= 'function onChangecontinent() {';
- $timezoneJs .= 'document.getElementById("city").innerHTML =';
- $timezoneJs .= ' citiescontinent[document.getElementById("continent").value]; }';
- $timezoneJs .= 'var citiescontinent = '.json_encode($cities).';';
- $timezoneJs .= '</script>';
+ $continents = array_keys($continents);
+ $continents['selected'] = $pcontinent;
+ $cities['selected'] = $pcity;