Hi everybody!

I want to load one listbox on the basis of the another in Java. The following function should work while I change country list.

function loadCountryRegion() {
var selectedCountryName = document.getElementById("listCountry").value;
type : 'GET',
dataType : 'json',
url : 'cs?action=getCountryRegionList&listCountry='+ selectedCountryName,
success : function(data) {
$.each(data.CountryRegionList, function(i, region) {
'<option value="' + region.name +'">'
+ region.name + '</option>');


But selectedCountryName is null. It doesn't contain the country name.

Could you please advise why it is null and what should I do?