I cannot test until you fix the two errors I have found
Error 2
return checkdate(document.form.dob.value);
is sending a string instead of field. Change to
return checkdate(document.form.dob);
to match
if (returnval==true) input.select()
so you can change
function checkdate(inputField) { // change to field
var input = inputField.value;
var validformat = /^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
var returnval = true
if (!validformat.test(input))
alert("Invalid Date Format. Format: (mm/dd/yyyy) \nPlease correct and submit again.")
else { //Detailed check for valid date ranges
var monthfield = input.split("/")[0]
var dayfield = input.split("/")[1]
var yearfield = input.split("/")[2]
var dayobj = new Date(yearfield, monthfield - 1, dayfield)
if ((dayobj.getMonth() + 1 != monthfield) || (dayobj.getDate() != dayfield) || (dayobj.getFullYear() != yearfield))
alert("Invalid Day, Month, or Year range detected. \nPlease correct and submit again.")
else
returnval = false
}
if (returnval == true) inputField.select(); // here we select the field
return returnval
}
Lastly I think you meant
if (!returnval) inputField.select();
No problem. You still will need my change to make the code not give errors. There is no select method of a string.
It is working if you ignore the console error and that the error field is not selected ;)
It’s likely still giving a console error. If you do not care you do not have to do anything - I would fix it had it been my site - anyway enjoy.
I cannot verify on my mobile. No big deal.
You for sure need to remove the "v" at the end of this line in PainDiagram.js
canvas.addEventListener('touchcancel', ev_canvas, false);v <<<<<