Hi, I am trying to create some javascript that will let the user enter a date (possibly using a date picker) and a time. When the user hit submit I want the timer to countdown to that date and sound an alarm at the time. I have the following bit of code that will allow the user to enter an number of seconds but I am haveing trouble expanding on this and getting a date picker involved so the user can enter an exact date and time. Any help would be great
Code:
<body>
<div id="countdown"></div>
<div id="notifier"></div>
<script type="text/javascript">
function startTimer() {
userInput = document.getElementById('userTime').value;
if(userInput.length == 0){
alert("Please enter a value");
} else {
var numericExpression = /^[0-9]+$/;
if(!userInput.match(numericExpression)){
alert("Please enter a number")
} else {
function display( notifier, str ) {
document.getElementById(notifier).innerHTML = str;
}
function toMinuteAndSecond( x ) {
return Math.floor(x/60) + ":" + x%60;
}