Bind a event listener to a submit form between a specific date and time in JavaScript -



Bind a event listener to a submit form between a specific date and time in JavaScript -

i want popup message when user click on submit button between date of 2012-01-22, 00:00 2012-01-25, 23:59. write code below, won't works. suggest how convert date integer can check if today date greater x , less x, popup message?

thanks

function holiday_alert_msg() { var today_date = new date(); if (today_date > 201201220000 && today_date < 201201252359) { alert("today holiday"); } } $('#submit').bind('click', function() { holiday_alert_msg(); });

you can this:

function holiday_alert_msg() { var today_date = new date(); // month parameter 0 based if (today_date > new date(2012,0,22) && today_date < new date(2012,0,25,23,59)) { alert("today holiday"); } } $('#submit').bind('click', holiday_alert_msg);

javascript

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -