I have a question. How would I be able to validate or format a location number 00-00-00-000-000 digits 0-9 where 0 is via java-script.
something like this
function formatTime(time) {
var result = false, m;
var re = /^\s*([01]?\d|2[0-3]):?([0-5]\d)\s*$/;
if ((m = time.match(re))) {
result = (m[1].length == 2 ? "" : "0") + m[1] + ":" + m[2];
}
return result;
}
alert(formatTime(" 1:00"));
alert(formatTime("1:00 "));
alert(formatTime("1:00"));
alert(formatTime("2100"));
alert(formatTime("90:00")); // false
Simple function: JSFiddle
works for any input string that is in the format
X-X-X-X-Xwhere the first three Xs can be between 0 and 99 and the last 2 Xs can be between 0 and 999.