|
|
|
function addrCountryChanged(){
|
|
|
|
var stat_select = document.getElementById('id_stat');
|
|
|
|
var stat_text = document.getElementById('id_li_stat_text');
|
|
|
|
var stat = stat_select[stat_select.selectedIndex].value;
|
|
|
|
if (stat === "other"){
|
|
|
|
stat_text.style.display="revert";
|
|
|
|
} else {
|
|
|
|
stat_text.style.display="none";
|
|
|
|
$('#id_stat_text').val("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function hideSchoolTextfields(){
|
|
|
|
var skola_nazev = document.getElementById('id_li_skola_nazev');
|
|
|
|
var skola_adresa = document.getElementById('id_li_skola_adresa');
|
|
|
|
var skola_vypln = document.getElementById('id_li_skola_vypln');
|
|
|
|
skola_nazev.style.display="none";
|
|
|
|
skola_adresa.style.display="none";
|
|
|
|
skola_vypln.style.display="none";
|
|
|
|
|
|
|
|
}
|
|
|
|
function schoolNotInList(){
|
|
|
|
var skola_nazev = document.getElementById('id_li_skola_nazev');
|
|
|
|
var skola_adresa = document.getElementById('id_li_skola_adresa');
|
|
|
|
var skola_vypln = document.getElementById('id_li_skola_vypln');
|
|
|
|
// FIXME nefunguje a nevim proc (TypeError: $(...).select2 is not a function)
|
|
|
|
//var skola_select = $('#id_skola').select2();
|
|
|
|
//skola_select.val(null).trigger('change');
|
|
|
|
skola_vypln.style.display="revert";
|
|
|
|
skola_nazev.style.display="revert";
|
|
|
|
skola_adresa.style.display="revert";
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function(){
|
|
|
|
addrCountryChanged();
|
|
|
|
hideSchoolTextfields();
|
|
|
|
});
|