I'm trying to let a user enter a time (Such as 07:00:00) then, run my javascript so that I can look at that time. At this point it will confirm the time with the user.. then If the time entered is between 7am and 6pm on a monday through Friday I want to pop up an extra "Are you sure?" Right now I'm just trying to get the time to work, then I'll move on to the day of the week part. heh. I'm having the hardest time getting the time to be seen as a date.. any help would be greatly appreciated.
function confirmsubresults() {
var my_begintime=new Date("07:00:00"
var my_endtime=new Date("18:00:00"
var my_enteredtime= new Date(document.mim.f_mac.value);
if (confirm("Are you sure you want to schedule for " +my_enteredtime+ "?")
if (my_enteredtime<=my_begintime && my_enteredtime>=my_endtime) {
return true;
} else {
if (confirm("The time you have scheduled for is between the hours of 7am and 6pm, are you absolutely sure you want to schedule for this time frame?")
return true;
else {
return false;
} } else {
return false;
} }
HTML
<form name="mim" onsubmit="return confirmsubresults();">
<input type="text" name=f_mac onblur="javascript: return document.mim.f_mac.length">
<input type="text" name=f_mac1 value="">
<input type=submit name=submit value=submit>
</form>
function confirmsubresults() {
var my_begintime=new Date("07:00:00"
var my_endtime=new Date("18:00:00"
var my_enteredtime= new Date(document.mim.f_mac.value);
if (confirm("Are you sure you want to schedule for " +my_enteredtime+ "?")
if (my_enteredtime<=my_begintime && my_enteredtime>=my_endtime) {
return true;
} else {
if (confirm("The time you have scheduled for is between the hours of 7am and 6pm, are you absolutely sure you want to schedule for this time frame?")
return true;
else {
return false;
} } else {
return false;
} }
HTML
<form name="mim" onsubmit="return confirmsubresults();">
<input type="text" name=f_mac onblur="javascript: return document.mim.f_mac.length">
<input type="text" name=f_mac1 value="">
<input type=submit name=submit value=submit>
</form>