1
0
Fork 0
foerderbarometer/input/static/dropdown/js/base.js

25 lines
628 B
JavaScript
Raw Normal View History

window.addEventListener("load", function() {
(function($) {
$(function() {
var selectField = $('#id_variant'),
verified = $('.field-url_of_pic');
function toggleVerified(value) {
if (value === 'PIC') {
verified.show();
} else {
verified.hide();
}
}
// show/hide on load based on existing value of selectField
toggleVerified(selectField.val());
// show/hide on change
selectField.change(function() {
toggleVerified($(this).val());
});
});
})(django.jQuery);
});