You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
643 B

window.addEventListener("load", function() {
(function($) {
$(function() {
var selectField = $('#id_variant'),
verified = $('#id_url_of_pic').parent().parent();
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);
});