Guys, I'm having a problem with the Magento Platform.
Trying to build an auto-populated option with Ajax, it works flawless in a simple folder outside Magento.
But with Magento, it's not populating from data.php
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("select[name='marca']").change(function(){
var optionValue = jQuery("select[name='marca']").val();
jQuery.ajax({
type: "POST",
url: "data.php",
data: ({marca: optionValue, status: 1}),
beforeSend: function(){ jQuery("#ajaxLoader").show(); },
complete: function(){ jQuery("#ajaxLoader").hide(); },
success: function(response){
jQuery("#modelAjax").html(response);
jQuery("#modelAjax").show();
}
});
});
});
</script>
If I include the source code from data.php it works but when the hiddent ID of #modelAjax is called to .show(); It loads the same page again with .html(response), page in page;
Is there another solution that i get just the requested data without .html() ?