When i click selectbox than i want to alert data.But it not working.what is the wrong in ajaxcalling.pls help
<?php
echo $this->Form->create('Office');
echo $this->Form->input('office_type', array('type' => 'select', 'id' =>'office_type_id','options' => $settings1,'empty' => false));
echo $this->Form->end('Save');
?>
<script type="text/javascript">
$("#office_type_id").change(function() {
var office_type_id=$('#office_type_id').val();
$.ajax({
url : "<?php echo Router::url(array('controller' => 'Offices', 'action' =>'getoffices'), true); ?>",
type : "POST",
cache : false,
data : {office_type_id: office_type_id},
alert(data);
success : function(data){
}
});
});
</script>