0

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() ?

Edited by Szabi Zsoldos

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by sonamhudson
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.