I want to give a validation that date before today cannot be selected . how to do it???

suprakash
Giga Expert

In date or date time field user will not be able to select the date before today .. how to do that????

4 REPLIES 4

moulik1
Kilo Guru

thameem1
Kilo Expert

Hi Suprakash



You can check this link of similar requirement which i have answered


i want to validate date is past or not if past want to display error msg using g_form.showfieldmess...



Regards


Thameem


Harish KM
Kilo Patron
Kilo Patron

Write a before BR on the table



(function executeRule(current, previous /*null when async*/) {




if(current.u_date < gs.nowDateTime()) // u_date is the field name


{


gs.addInfoMessage('Invalid date.today and Past dates cannot be selected');


current.setAbortAction(true);


}




})(current, previous);


Regards
Harish

amlanpal
Kilo Sage

Hi Suprakash,



Please find the below threads. These may help you:


Date Validation UI Policy


How to write a date validation script in server side?



I hope this helps.Please mark correct/helpful based on impact