forked from beba/foerderbarometer
added dropdown agreement to send my data for buying literature for me
This commit is contained in:
parent
0d51dae174
commit
4c016a4a5a
|
@ -1,6 +1,30 @@
|
||||||
window.addEventListener("load", function() {
|
window.addEventListener("load", function() {
|
||||||
(function($) {
|
(function($) {
|
||||||
$(function() {
|
$(function() {
|
||||||
|
var selectField_selfbuy = $('#id_selfbuy'),
|
||||||
|
verified_selfbuy_div = $('#id_selfbuy_give_data').parent().parent(),
|
||||||
|
verified_selfbuy = $('#id_selfbuy_give_data');
|
||||||
|
|
||||||
|
function toggleVerified_selfbuy(value) {
|
||||||
|
if (value === "FALSE") {
|
||||||
|
verified_selfbuy_div.show();
|
||||||
|
verified_selfbuy.prop("checked", false);
|
||||||
|
} else {
|
||||||
|
verified_selfbuy_div.hide();
|
||||||
|
verified_selfbuy.prop("checked", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// show/hide on load based on existing value of selectField
|
||||||
|
toggleVerified_selfbuy(selectField_selfbuy.val());
|
||||||
|
|
||||||
|
// show/hide on change
|
||||||
|
selectField_selfbuy.change(function() {
|
||||||
|
toggleVerified_selfbuy($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var selectField = $('#id_variant'),
|
var selectField = $('#id_variant'),
|
||||||
verified = $('#id_url_of_pic').parent().parent();
|
verified = $('#id_url_of_pic').parent().parent();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue