I have used the onclick() javascript event in my cake app. but that not work in google chrome and safari. here is the my code
<select name="ovwear" >
<option>--Select Category--</option>
<?php
$i = 1;
foreach($styleDetail as $key=>$val) { ?>
<option onClick="catDetail(<?php echo $val['shop_style_categories']['cat_id'].",".$val['shop_style_categories']['parent_id'] ?>);" value="<?php echo $i;?>">Category <?php echo $i;?></option>
<?php $i++; } ?>
</select>
here is the function:
<script type="text/javascript">
function catDetail(cat_id,parent_id){
//alert("called here");
var cat_id = cat_id;
var parent_id = parent_id;
jQuery.ajax({
type: "POST",
url: "/admin/shop/styledata",
data:"cat_id=" + cat_id,
dataType: "html",
success: function(data) {
$("#alertt").html(data);
}
});
}
</script>