Managed Metadata column required

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
asharma190
Posts: 4
Joined: Wed Feb 26, 2020

10 Jun 2020

I am having trouble setting a managed metadata column (name: key industry) required on submit --- I am using the below (which has worked before in other field types). Just need a basic on submit check --- cannot set it on the list as required due to other technical reasons. Any help would be appreciated. Thanks!

fd.onsubmit(function () {
if fd.field('KeyIndustry').value() == '') {
alert('Please, fill in key industry');
return false;
}
}

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

11 Jun 2020

Hello asharma190,

There are typos in your code, please see updated code:

Code: Select all

fd.onsubmit(function () {
	if (fd.field('KeyIndustry').value() == '') {
		alert('Please, fill in key industry');
		return false;
	}
	    return true;
});
Also, if 'KeyIndustry' is Managed Metadata field, use this code to check if it has value:

Code: Select all

fd.field('FieldName').control()._el().find('.ms-taxonomy .valid-text').length == 0

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests