Hide/show field on display form
Posted: 31 May 2016
Hello, I have a little question.
I was hiding showing some fields in the edit and new form based on a checkbox.
I have this and its working fine :
function setHide() {
var v = fd.field('NewColumn3').control().value();
if (fd.field('NewColumn3').value()) {
$('.Abstellmaßnahmen').show(); // Enable
} else {
$('.Abstellmaßnahmen').hide(); // Disable
}
}
// Subscribe on status change
fd.field('NewColumn3').control().change(function () {
setHide();
});
// Initialize
setHide();
----------------------------------
My problem is that when i try to make it on the display form, i cannot find the way to make it with the same method.
here an example :
function setShow() {
var v = fd.field('NewColumn3').control().value();
if (v == 'Yes' || v == 'No') {
$('.Abstellmaßnahmen').show(); // Enable
} else {
$('.Abstellmaßnahmen').hide(); // Disable
}
}
// Subscribe on status change
fd.field('NewColumn3').control().change(function () {
setShow();
});
// Initialize
setShow();
Can you tell me what i missed, please
Gianni
I was hiding showing some fields in the edit and new form based on a checkbox.
I have this and its working fine :
function setHide() {
var v = fd.field('NewColumn3').control().value();
if (fd.field('NewColumn3').value()) {
$('.Abstellmaßnahmen').show(); // Enable
} else {
$('.Abstellmaßnahmen').hide(); // Disable
}
}
// Subscribe on status change
fd.field('NewColumn3').control().change(function () {
setHide();
});
// Initialize
setHide();
----------------------------------
My problem is that when i try to make it on the display form, i cannot find the way to make it with the same method.
here an example :
function setShow() {
var v = fd.field('NewColumn3').control().value();
if (v == 'Yes' || v == 'No') {
$('.Abstellmaßnahmen').show(); // Enable
} else {
$('.Abstellmaßnahmen').hide(); // Disable
}
}
// Subscribe on status change
fd.field('NewColumn3').control().change(function () {
setShow();
});
// Initialize
setShow();
Can you tell me what i missed, please
Gianni