visibility and radio buttons

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
oren944
Posts: 8
Joined: Wed Feb 04, 2015

11 Feb 2015

Hello,

I am trying to hide the information when the radio button is selected to no and then when the user click on yes the information appears.

this is what i have so far....

fd.field('Office_x0020_Contact').control().change(function()
{
if (fd.field('Office_x0020_Contact').value() == 'No')
{
$('.fd_field[fd_name="Office_x0020_Location"]').hide();
$('.fd_field[fd_name="Office_x0020_Phone_x0020_Number"]').hide();
$('.fd_field[fd_name="Office_x0020_IM"]').hide();
$('.fd_field[fd_name="Office_x0020_Mail_x0020_Box"]').hide();
}

else
{
$('.fd_field[fd_name="Office_x0020_Location"]').show();
$('.fd_field[fd_name="Office_x0020_Phone_x0020_Number"]').show();
$('.fd_field[fd_name="Office_x0020_IM"]').show();
$('.fd_field[fd_name="Office_x0020_Mail_x0020_Box"]').show();
}
});

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

12 Feb 2015

Hi,

Radio button fields return index of the selected option:

fd.field('Office_x0020_Contact').control().change(function()
{
if (fd.field('Office_x0020_Contact').value() == 1)
{
...
}
else
{
...

}
});

oren944
Posts: 8
Joined: Wed Feb 04, 2015

12 Feb 2015

Thank you! Much appreciated

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests