Issue with conditionaly checkbox

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
cmagnan
Posts: 23
Joined: Fri Jan 26, 2018

16 Mar 2018

Hi,

I have a small problem
If the TranslationAvailability is check, the field 'TranslationItemCreation needs to be check.
If the TranslationAvailability is not check, the field 'TranslationItemCreation needs to be uncheck

Problem
When I check the field TranslationAvailability, the field TranslationItemCreation is correctly check, but when I uncheck it the TranslationAvailability is keeping check


function setTranslationItemCreation()
{
var v = fd.field('TranslationAvailability').control().value();
if (fd.field('TranslationAvailability').value())
{

fd.field('TranslationItemCreation').value('Yes');
}
else
{
fd.field('TranslationItemCreation').value('No');

}
}
// Subscribe on status change
fd.field('TranslationAvailability').control().change(function ()
{
setTranslationItemCreation();
});
// Initialize
setTranslationItemCreation();

Can you help me to solve my issue
Thanks
Catherine

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

16 Mar 2018

Dear Catherine,
Please, try this code:

Code: Select all

function setTranslationItemCreation(){
    if(fd.field('TranslationAvailability').value()){
        fd.field('TranslationItemCreation').value(true);    
    }    
    else{
        fd.field('TranslationItemCreation').value(false);
    } 
} 

// Subscribe on status change 
fd.field('TranslationAvailability').change(function(){ 
    setTranslationItemCreation(); 
}); 

// Initialize 
setTranslationItemCreation();
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests