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.
 
 
 

35 lines
1014 B

window.addEventListener("load", function() {
(function($) {
$(function() {
// mail section
var selectField_addrOther = $('#id_address'),
data_addrOther_div = $('#id_other').parent().parent(),
data_addrOther = $('#id_other');
console.log(data_addrOther, data_addrOther_div );
// make checked to get through the required
function toggleVerified_addrOther(value) {
if (value === "OTHER") {
data_addrOther_div.show();
data_addrOther.val("");
} else {
data_addrOther_div.hide();
data_addrOther.val("NONE");
}
}
// show/hide on load based on existing value of selectField
toggleVerified_addrOther(selectField_addrOther.val());
// show/hide on change
selectField_addrOther.change(function() {
toggleVerified_addrOther($(this).val());
});
});
})(django.jQuery);
});