How to make "SharePoint:FormField" required?

3.4k Views Asked by At

I'm making a SharePoint 2010 new/edit item custom form. I have a title field:

<SharePoint:FormField runat="server" ID="fieldFileLeafRef" ControlMode="Edit" FieldName="FileLeafRef" />

How to make this field required?

1

There are 1 best solutions below

3
On

FormField is a Control that would render the UI for any of the Field you assign it to , it doesn't not represent any field Statically. In your code you are refering or pointing the FormField to point to FieldName="FileLeafRef", so in this case you will need to set the Field as Required in your Content Type or List so that FormField will render a validator or do validations.