Required Fields for every Department

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
TWendt
Posts: 109
Joined: Mon Sep 08, 2014

28 Sep 2016

Hi all,

i have six departments. For every department i have a choice field Approved / Not approved, a date field and a people picker field. If the choice field is marked, the other fields should be required. What must i do?

Best wishes

Tom

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

28 Sep 2016


TWendt
Posts: 109
Joined: Mon Sep 08, 2014

30 Sep 2016

Hi Dmitry,

thanks for the information. But can you give me more information about a choice field with radio buttons 'PME_x002d_Freigabe'?

function setRequiredFields() { if (fd.field('PME_x002d_Freigabe').value().dictionaryEntries.length != 0) { // Add asterisks fd.field('PME_x002d_Datum').titleRequired(true); } else { // Remove asterisks fd.field('PME_x002d_Datum').titleRequired(false); } } Unfortunately it does not work. Best regards Tom

YuriyMedvedev
Moderator
Posts: 33
Joined: Wed Sep 21, 2016

02 Oct 2016

Hi!

For radio-buttons you have to use just "value()", like in this example. Here, if first radio is choosen "Name"-field is not required, but if you chose other radio - it is required.



function setRequiredFields() {

if (fd.field('Radio').value() != 0) {

fd.field('Name').titleRequired(true); }

else {

fd.field('Name').titleRequired(false); } }

fd.field('Radio').change(function(){

setRequiredFields();

});

setRequiredFields();

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests