Hello,
I use javascript to hide or show some elements or groups depending on a checkbox value.
For the form view its okay and works perfect, but in display view the javascript doesnt work and I see every time all elements.
This is my code I use. How can I change them or which code do I have to add that the code is also working for display view?
var div = $('rfp_overviews___welche_messen');
var inputs = div.getElements('input[type=checkbox]');
for (i=0; i < inputs.length; i++) {
if (inputs.checked && inputs.value == '1') {
document.id('group62').show();
}
if (!inputs.checked && inputs.value == '1') {
document.id('group62').hide();
}
if (inputs.checked && inputs.value == '2') {
document.id('group63').show();
}
if (!inputs.checked && inputs.value == '2') {
document.id('group63').hide();
}
I use javascript to hide or show some elements or groups depending on a checkbox value.
For the form view its okay and works perfect, but in display view the javascript doesnt work and I see every time all elements.
This is my code I use. How can I change them or which code do I have to add that the code is also working for display view?
var div = $('rfp_overviews___welche_messen');
var inputs = div.getElements('input[type=checkbox]');
for (i=0; i < inputs.length; i++) {
if (inputs.checked && inputs.value == '1') {
document.id('group62').show();
}
if (!inputs.checked && inputs.value == '1') {
document.id('group62').hide();
}
if (inputs.checked && inputs.value == '2') {
document.id('group63').show();
}
if (!inputs.checked && inputs.value == '2') {
document.id('group63').hide();
}