I have fields in my program that needs to accept numbers and only numbers (i.e., characters 0123456789). Right now my program as follows sort of shrugs and accepts whatever is put in (FormatData = Value). Anything else I attempt (i.e., Response.Write "Must be numeric" comes out very strange and does not allow for non-entry of fields.
I have a javascript that works quite well for this function on another program. How do I incorporate this javascript with the above VBScript?
Code:
function FormatData(Value,Format)
const fdCURRENCY=3
Format=trim(Format)
Value=trim(Value)
if isnumeric(Format) then
Format=clng(Format)
...
Select Case Format
Case fdNUMERIC
if isnumeric(Value) then
FormatData=FormatNumber(Value,0)
else
FormatData=Value
end if
Case Else 'do nothing
FormatData=Value
End Select
else
'if the Format value isn't numeric, just return the original value
FormatData=Value
end if
end function
I have a javascript that works quite well for this function on another program. How do I incorporate this javascript with the above VBScript?