92 lines
1.9 KiB
JavaScript
92 lines
1.9 KiB
JavaScript
Sub ShowErrorBox(msg,title)
|
|
Style = vbOKOnly + vbExclamation + vbCritical
|
|
Ctxt = 1000
|
|
Response = msgbox(msg, Style,title, Help, Ctxt)
|
|
end sub
|
|
|
|
|
|
sub ToggleBtn (x,value)
|
|
if (value = true) then
|
|
x.disabled = false
|
|
else
|
|
x.disabled = true
|
|
end if
|
|
|
|
end sub
|
|
|
|
sub ToggleLink(x,value)
|
|
if (value = true) then
|
|
x.style.textDecoration = "none"
|
|
x.disabled = false
|
|
else
|
|
x.style.textDecoration = "line-through"
|
|
x.disabled = true
|
|
end if
|
|
end sub
|
|
|
|
sub SetVisible(x,value)
|
|
if (value = true) then
|
|
x.style.display = "inline-block"
|
|
else
|
|
x.style.display = "none"
|
|
end if
|
|
end sub
|
|
|
|
|
|
function RequiredField(FormName,RequiredFieldArray,RequiredFieldNameArray)
|
|
dim i,data,msg
|
|
RequiredField = true
|
|
for each data in FormName
|
|
if (ucase(data.type)="TEXT") or (ucase(data.type)="FILE") or (ucase(data.type)="PASSWORD") then
|
|
for i=lbound(requiredFieldArray) to ubound(requiredFieldArray)
|
|
if data.name=requiredFieldArray(i) then
|
|
dim test
|
|
test = IsNull(data.value)
|
|
if (data.value = "") then
|
|
msg = "Field '" & RequiredFieldNameArray(i) & "' can not be empty!"
|
|
ShowErrorBox msg,"Required Field"
|
|
data.focus()
|
|
RequiredField = false
|
|
exit for
|
|
end if
|
|
end if
|
|
next
|
|
if (RequiredField = false) then
|
|
exit for
|
|
end if
|
|
end if
|
|
next
|
|
end function
|
|
|
|
function confirmation(text,title)
|
|
dim style
|
|
style = vbYesNo + vbExclamation + vbDefaultButton2
|
|
Ctxt = 1000
|
|
|
|
Response = MsgBox(text, style, title, Help, Ctxt)
|
|
If Response = vbYes Then
|
|
confirmation = true
|
|
else
|
|
confirmation = false
|
|
End If
|
|
End function
|
|
|
|
function alerter(text,title,style)
|
|
dim defaultStyle
|
|
defaultStyle = vbOkOnly + vbDefaultButton1
|
|
|
|
if (style = "") then
|
|
style = defaultStyle + vbCritical
|
|
else
|
|
style = CInt(style) + defaultStyle
|
|
end if
|
|
|
|
Ctxt = 1000
|
|
|
|
Response = MsgBox(text, style, title, Help, Ctxt)
|
|
If Response = vbOk Then
|
|
alerter = true
|
|
else
|
|
alerter = false
|
|
End If
|
|
End function |