$(document).ready(function(){
    $("input:radio,select#secao").change(function(){
        var Val = $(this).val();
        $.ajax({
            type: "post",
            url: "ajaxFiles/cadastro.php",
            data: "getType=categorias&val="+Val,
            dataType: "html",
            success: function(response){
                $("#categoria").html("");
                $("#categoria").append(response);
            }
        })
    })
    $("#categoria").change(function(){
        var selectVal = $(this).val();
        $.ajax({
            type: "post",
            url: "ajaxFiles/cadastro.php",
            data: "getType=subCategorias&val="+selectVal,
            dataType: "html",
            success: function(response){
                $("#subCategorias").html("");
                $("#subCategorias").append(response);
            }
        })
    })
})
