CodeIgniter Forums
How can i perform these validations ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How can i perform these validations ? (/showthread.php?tid=20417)



How can i perform these validations ? - El Forum - 07-09-2009

[eluser]aamiraziz[/eluser]
i am working on job portal. i need a validation that :

in creating online CV if user enters the start date of his degree then he can not enter the end date of that degree which is less than start date e.g

degree start date = 2005-08-01
degree end date = 2004-08-1



How can i perform these validations ? - El Forum - 07-09-2009

[eluser]Colin Williams[/eluser]
Why not write a callback function?


How can i perform these validations ? - El Forum - 07-09-2009

[eluser]Dam1an[/eluser]
Although you'd still want the callback function to do the check server side, some JS date pickers let you have to and from dates, where once you select the 'from', all dates before then are made unclickable in the 'to' selection


How can i perform these validations ? - El Forum - 07-09-2009

[eluser]TheFuzzy0ne[/eluser]
You should be able to use strtotime() to get a timestamp, and then do the maths on that.