khile Posted October 26, 2010 Share Posted October 26, 2010 im trying to do a live date checker so for example if someone entered 26/10/2010 in the field it would be valid but if they entered tommorows date or 26/10/2011 if would tell them stright away its wrong Quote Link to comment Share on other sites More sharing options...
akitchin Posted October 26, 2010 Share Posted October 26, 2010 for this you would need a simple PHP AJAX form validation script of some sort (jQuery's example is on their website). provided you can standardize the user's input, the PHP code to verify it should be simple: 1. validate the actual format of the date (see here for a quick tutorial on how to write this part). 2. convert the value to a timestamp using strtotime, and compare it against the current timestamp (using time). Quote Link to comment Share on other sites More sharing options...
MPeter Posted October 31, 2010 Share Posted October 31, 2010 Hello, khile. Look up here, too! http://www.w3schools.com/js/default.asp http://www.w3schools.com/js/js_ex_objects.asp http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_gettime The only thing the FORM does need to work could be that then: var servermicroseconds = <?PHP echo(microtime(true)); ?>; Have fun exploring! Regards, MPeter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.