$(document).ready(function () {

    var $id_type = $('[id$=type]');

    $id_type.each(function() {
        if($(this).val() == 'p'){
            $('[id$=periodical]').parents('.row').show();
            $('[id$=date]').parents('.row').show();
            $('[id$=event]').parents('.row').hide();
        } else if($(this).val() == 'e'){
            $('[id$=event]').parents('.row').show();
            $('[id$=periodical]').parents('.row').hide();
            $('[id$=date]').parents('.row').hide();
        } else{
            $('[id$=periodical]').parents('.row').hide();
            $('[id$=event]').parents('.row').hide();
            $('[id$=date]').parents('.row').hide();
        }
    });

    $id_type.change(function(){
        if($(this).val() == 'p'){
            $('[id$=periodical]').parents('.row').show();
            $('[id$=date]').parents('.row').show();
            $('[id$=event]').parents('.row').hide();
        } else if($(this).val() == 'e'){
            $('[id$=event]').parents('.row').show();
            $('[id$=periodical]').parents('.row').hide();
            $('[id$=date]').parents('.row').hide();
        } else{
            $('[id$=periodical]').parents('.row').hide();
            $('[id$=event]').parents('.row').hide();
            $('[id$=date]').parents('.row').hide();
        }
    });
});

$(document).ready(function () {

    var $id_type = $('#id_type');

    $id_type.each(function() {
        if($(this).val() == 'p'){
            $('[id^="publishedinperiodical"]').parents('._inline-group').show();
            $('[id^="publishedinevent"]').parents('._inline-group').hide();
        } else if($(this).val() == 'e'){
            $('[id^="publishedinperiodical"]').parents('._inline-group').hide();
            $('[id^="publishedinevent"]').parents('._inline-group').show();
        } else{
            $('[id^="publishedinperiodical"]').parents('._inline-group').hide();
            $('[id^="publishedinevent"]').parents('._inline-group').hide();
        }
    });

    $id_type.change(function(){
        if($(this).val() == 'p'){
            $('[id^="publishedinperiodical"]').parents('._inline-group').show();
            $('[id^="publishedinevent"]').parents('._inline-group').hide();
        } else if($(this).val() == 'e'){
            $('[id^="publishedinperiodical"]').parents('._inline-group').hide();
            $('[id^="publishedinevent"]').parents('._inline-group').show();
        } else{
            $('[id^="publishedinperiodical"]').parents('._inline-group').hide();
            $('[id^="publishedinevent"]').parents('._inline-group').hide();
        }
    });
});

Enable or disable an inline in accordance with the type of article
Enable or disable an inline in accordance with the type of article
