I have a custom new form for SharePoint 2013 List which has multiple required field and when I click on Submit, validation of form works fine and if any mandatory field is blank,it shows error in red "You must specify a value for this required field."

Issue is If I mark DateTime field as mandatory then mandatory validation is not working properly.It is not validating all mandatory fields and showing message in red on submitting/adding new record. This is issue only when using custom form,not in default newform.aspx.

I saw similar issue here but not proper answer why this is occuring and how to resolve?

                        <td width="190px" valign="top" class="ms-formlabel">
                            <H3 class="ms-standardheader">
                                <nobr>Date of Discovery<span class="ms-formvalidation"> *</span></nobr>
                                <i  class="fa fa-info-circle"></i>
                                 <span class="tooltip-text">
                                  Please enter date of discovery.

                        <td width="700px" valign="top" class="ms-formbody">
                            <SharePoint:FormField runat="server" id="ff8{$Pos}" ControlMode="New" FieldName="Date_x0020_of_x0020_Discovery" __designer:bind="{ddwrt:DataBind('i',concat('ff8',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Date_x0020_of_x0020_Discovery')}"/>
                            <SharePoint:FieldDescription runat="server" id="ff8description{$Pos}" FieldName="Date_x0020_of_x0020_Discovery" ControlMode="New"/>

  • Can you add the code you are using in your custom form to your question? that will be helpful to answer your question if you are missing anything. – Ganesh Sanap Nov 21 at 8:21
  • updated with sample code for one of the field – F11 Nov 21 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.