/** * Populates the states list based on selected country * * @param String $country Country code of currently selected country. */ function populateStates($country) { $objResponse = new xajaxResponse(); $provinceList = RecruitmentController::getProvinceList($country); if ($provinceList) { $xajaxFiller = new xajaxElementFiller(); $xajaxFiller->setDefaultOptionName($GLOBALS['lang_Common_Select']); $objResponse->addAssign('state', 'innerHTML', '<select name="txtProvince" id="txtProvince" name="txtProvince" tabindex="8"><option value="0">--- ' . $GLOBALS['lang_Common_Select'] . ' ---</option></select>'); $objResponse = $xajaxFiller->cmbFillerById($objResponse, $provinceList, 1, 'fromJobApplication.state', 'txtProvince'); } else { $objResponse->addAssign('state', 'innerHTML', '<input type="text" id="txtProvince" name="txtProvince" tabindex="8" >'); } $objResponse->addScript('hideLoading();formJobApplication.txtProvince.focus();'); return $objResponse->getXML(); }