Make formfields required in different form
-
10-12-2019 - |
Question
I have two "New item" forms, and I have been wondering, is it possible to make the some of the fields required in one form, and in the second form the same fields not required.
I tried to add required="TRUE" to the field which I want to be required but it wont work that way.
Solution
You can create two different ContentTypes
<ContentType ID="CTA_ID" Name="ContentTypeA" Version="0" Overwrite="TRUE">
<FieldRefs>
<FieldRef ID="{Field_ID}" Name="MyField" Required="True"/>
</FieldRefs>
</ContentType>
<ContentType ID="CTB_ID" Name="ContentTypeB" Version="0" Overwrite="TRUE">
<FieldRefs>
<FieldRef ID="{Field_ID}" Name="MyField" Required="False"/>
</FieldRefs>
</ContentType>
Add to list and using for different new forms.
If it is not clear for you, please provide additional information about the problem (What is the new forms? Code samples? etc.)
Thanks
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange