0

I need a validation functionality for two date fields which should show an error if days between days <15 or >45 in VF page.

This is the backend validation:

(End_Date__c - Start_Date__c ) < 15 || ( 

End_Date__c - Start_Date__c ) > 45

I just want Front-end validation for above validation rule? can anyone suggest me because I'm not good at javascript

Here is the vf code:

<apex:actionRegion >
     <section id="myinformation-content">
                    <article>
                        <dl class="col-1">
                            <dt><b style="color:red;">*</b>start date </dt>
                           <dd> <apex:inputField id="startdate" value="{!caseRecord.Start_Date__c}"/></dd>
                        </dl>

                        <dl class="col-1">
                            <dt><b style="color:red;">*</b>end date</dt>
                           <dd> <apex:inputField id="enddate" value="{!caseRecord.End_Date__c}"/></dd>
                        </dl>
                   </article>
                    </section>
1
  • You need to share vf code
    – NITHESH K
    Commented Nov 30, 2017 at 10:08

1 Answer 1

0

Please refer this solution posted by Jon:

How to compare 2 dates in JavaScript on a Visualforce page?

You must log in to answer this question.