url = "/property/realestate_statistics/"; lngCityId = $('#cboCityName').val(); $.post( url, { "act" : "GetCommonLocation", "CityId" : lngCityId }, function(responseText){ $('#cboLocation').html(responseText); $('#cboPropertyType').html(''); $('#cboPropertyType').append( new Option('Property Type','')); $('#cboPropertyType').val('Property Type'); }, "html" );
I have a response text coming after changing city and this will be populated in second drop down
cboLocation. Now the third drop down should be repopulated based on property type at city by taking common location selected in to consideration. for that you should reset property type apart from resetting cboLocation.
To do so
$('#cboPropertyType').html(''); $('#cboPropertyType').append( new Option('Property Type','')); $('#cboPropertyType').val('Property Type');
- $(‘#cboPropertyType’).html(”) – To empty the Content of Drop down
- $(‘#cboPropertyType’).append( new Option(‘Property Type’,”)) – It should Contain only Property Type in Option so i am Appending that
- $(‘#cboPropertyType’).val(‘Property Type’) – It should point to only one option that exixts