I am trying to change a drop down based on a previously selected drop down. I am able to write the function in jQuery.
Since i am not able to use the URL path across various installation based on the server as i have to hard core the URL into the script.
<script type="text/javascript">
function getCategory(){
var industryId = $("#CompanyCompanyIndustryId").val();
$.getJSON('http://localhost/gitgrow/users/fetch/'+industryId, function(data) {
var options = '';
$.each(data, function(key, value) {
options += '<option value="' + key + '">' + value + '</option>';
});
$("#CompanyCompanyCategoryId").html(options);
})
}
</script>
How to achieve the same using CakePHP and JS component ?