PrivateFunction GetJavaScripts() AsString Dim strScript AsString = "<script language=""JavaScript"">" strScript &= ControlChars.CrLf strScript &= "<!--" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= "function
CheckMaskValue(maskControl, evt)" strScript &= ControlChars.CrLf strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "var strText =
maskControl.value;" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "if
((evt.keyCode < 48) || (evt.keyCode > 57))" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "evt.keyCode =
0;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= "function
CheckMaskFormat(maskControl)" strScript &= ControlChars.CrLf strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "var strText = maskControl.value;" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "var a =
strText.split(':');" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "if
(isNaN(a[0]))" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = '00:00';" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "else if
(isNaN(a[1]))" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "if
((a[0].length == 5) || (a[0].length == 4))" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText =
strText.slice(0,2) + ':' + strText.slice(2,4);" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "if
(a[0].length == 3)" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText = '0'
+ strText.slice(0,1) + ':' + strText.slice(1,3);" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "if
(a[0].length == 2)" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText =
strText.concat(':00');" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "if
(a[0].length == 1)" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText = strText.concat(':00');" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "else if
(a[1].length == 1)" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText =
strText.concat('0');" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "else if
(a[0].length == 1)" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "strText = '0'
+ strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.value = strText;" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "strText =
maskControl.value;" strScript &= ControlChars.Tab strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "strText =
strText.slice(3,5);" strScript &= ControlChars.Tab strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "if (strText
> 59)" strScript &= ControlChars.Tab strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "{" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &= "alert('You
have entered more than 59 minutes');" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= ControlChars.Tab strScript &=
"maskControl.select();" strScript &= ControlChars.CrLf strScript &= ControlChars.Tab strScript &= "}" strScript &= ControlChars.CrLf strScript &= ControlChars.CrLf IfMe.MaskFormat = "Hour of Day (hh:mm)" Then strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &= "strText =
maskControl.value;" strScript &=
ControlChars.Tab strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &= "strText =
strText.slice(0,2);" strScript &=
ControlChars.Tab strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &= "if
(strText > 23)" strScript &= ControlChars.Tab strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &= "{" strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &=
ControlChars.Tab strScript &=
"alert('You have entered more than 23 hours');" strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &=
ControlChars.Tab strScript &= "maskControl.select();" strScript &=
ControlChars.CrLf strScript &=
ControlChars.Tab strScript &= "}" strScript &=
ControlChars.CrLf strScript &=
ControlChars.CrLf EndIf strScript &= "}" strScript &= ControlChars.CrLf strScript &= "-->" strScript &= ControlChars.CrLf strScript &=
"</script>" strScript &= ControlChars.CrLf Return strScript EndFunction |