Boolean field values in the Edit form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
TomGullberg
Posts: 1
Joined: Fri Mar 01, 2019

20 Mar 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?

User avatar
AlexZver
Posts: 232
Joined: Mon Aug 27, 2018

21 Mar 2019

Dear Tom,

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();
    }
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests