So the scenario is on my page I have a form along with a countdown timer. If the countdown timer reaches 0:00 I have a statement which activates and is supposed to submit the form as it stands.
here is that statement:
if (Todays_Date >= Target_Date) {
clearTimeout(timeoutID);
$('#testForm').submit();
alert("Timeup, Submitting exam....");
return;
}
what actually happens is, it fires, the timer stops (cleared timeout) and alert pops up. However the form does not submit and take the user to the action page.
I have copied all of the code into thisjsfiddle to layout the basic principle.
the time of which countdown is targetted to is passed in the HTML at the bottom. you'll see the countdown() call.
I really am in a pickle and would appreciate someones help.
note: I know this is not a secure method etc.
many thanks