<commit_before>$(document).ready(function(){
    $('.control-group:has(.suggestions-hidden)').addClass("hidden");

    $('#id_agency_type').bind('change', HideShowFields);

    function HideShowFields(evt){
        var options = evt.target,
            value = options.value;
        switch(value){
            case "county":
                $(".control-group:has(.suggestions-city)").addClass("hidden");
                $(".control-group:has(.suggestions-county)").removeClass("hidden");
                break;
            case "city":
                $(".control-group:has(.suggestions-city)").removeClass("hidden");
                break;
            default:
                $('.control-group:has(.suggestions-hidden)').addClass("hidden");
                break;
        }
    }
});<commit_msg>Fixed js issue when form had errors.<commit_after>$(document).ready(function(){

    $('#id_agency_type').bind('change', HideShowFields);

    function HideShowFields(evt){
        var options = evt.target,
            value = options.value;
        switch(value){
            case "county":
                $(".control-group:has(.suggestions-city)").addClass("hidden");
                $(".control-group:has(.suggestions-county)").removeClass("hidden");
                break;
            case "city":
                $(".control-group:has(.suggestions-city)").removeClass("hidden");
                break;
            default:
                $('.control-group:has(.suggestions-hidden)').addClass("hidden");
                break;
        }
    }

    $('#id_agency_type').trigger('change')
});
{'fraction_non_alphanumeric': 0.17314930991217065, 'fraction_numerical': 0.0, 'mean_word_length': 2.049713193116635, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6070534', 'n_tokens_mistral': 448, 'n_tokens_neox': 414, 'n_words': 54}