Boolean field values in the Edit form
-
- Posts: 1
- Joined: Fri Mar 01, 2019
Hi, I have to buttons that I want to hide/show based on a checkbox Field in my form - I can get the value from the Boolean Field in the Display form but not in my Edit form. This is my code:
//Field "LederFerdig" is a checkbox - show/hide buttons if checked or not
function showHideButtons(){
var Sent = fd.field('LederFerdig').value();
alert(Sent);
if (Sent == 'true' ) {
$('.oppdateringbutton').show();
$('.ferdigbutton').hide();
}
else {
$('.oppdateringbutton').hide();
$('.ferdigbutton').show();
}
}
//call function on opening
showHideButtons();
The output form the alert(Sent) above is "true" or "false" but my condition if does not work (it always goes to the ELSE regardless of true/false value in the variable "Sent". Any thoughts?
//Field "LederFerdig" is a checkbox - show/hide buttons if checked or not
function showHideButtons(){
var Sent = fd.field('LederFerdig').value();
alert(Sent);
if (Sent == 'true' ) {
$('.oppdateringbutton').show();
$('.ferdigbutton').hide();
}
else {
$('.oppdateringbutton').hide();
$('.ferdigbutton').show();
}
}
//call function on opening
showHideButtons();
The output form the alert(Sent) above is "true" or "false" but my condition if does not work (it always goes to the ELSE regardless of true/false value in the variable "Sent". Any thoughts?
Dear Tom,
Please try this code for the Edit Form:
Please try this code for the Edit Form:
Code: Select all
function showHideButtons(){
var Sent = fd.field('LederFerdig').value();
if (Sent) {
$('.oppdateringbutton').show();
$('.ferdigbutton').hide();
} else {
$('.oppdateringbutton').hide();
$('.ferdigbutton').show();
}
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests