Hide a field

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Eax
Posts: 32
Joined: Wed Oct 28, 2015

09 Nov 2015

Hello,

I have a question about JS :

I try to hide a field when a selection in the other field is made but it doesnt work :

This is my actual code

var Part = fd.field('Typedaffaire').value();
if (Part == 'SEP') {
$('.Partenaires').show();
} else {
$('.Partenaires').hide();
}

Something is wrong ?

Best regards,

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

09 Nov 2015

You need to wrap that in an onchange event handler, like this:

Code: Select all

fd.field('Typedaffaire').change(function(){
 var Part = fd.field('Typedaffaire').value();
 if (Part == 'SEP') {
  $('.Partenaires').show();
 } else {
  $('.Partenaires').hide();
 }
});

Eax
Posts: 32
Joined: Wed Oct 28, 2015

10 Nov 2015

Work for me ! Thanks

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests