Hide/show field on display form
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
Use:
to get the value of the checkbox
Code: Select all
fd.field('NewColumn3').control()._el().text()
-
- Posts: 5
- Joined: Sun Sep 11, 2016
may i ask how the final form for the display form have to look like now?
just interested. and i'm very new to JS sry.
thx and regards,
TK
just interested. and i'm very new to JS sry.
thx and regards,
TK
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests