Johnny
|
| Posted: 04/29/2003, 6:48 PM |
|
Where i Could read More aboutit?
like Example for phone Number (999)999-999 and others?
etc?
|
|
|
 |
rrodgers
|
| Posted: 05/03/2003, 4:43 AM |
|
in what language? Server Side or Client Side?
Server side.
Add an event to "On Validate". Put your validate code there.
Client Side.
I like to use the onblur event for the field and call a validate function.
Post your prefered language and maybe I or someone else can get you going.
This is the code I use for client side ASP phone validation.
<script language="VBScript">
<!--
Sub ValidPhone(xObj)
Dim xChar
Dim xTempNumber
For xLoopCount = 1 To Len(xObj.Value)
xChar = Mid(xObj.Value,xLoopCount,1)
If IsNumeric(xChar) = True Then
xTempNumber = xTempNumber & xChar
End IF
Next
If Len(Trim(xTempNumber)) = 0 Then
xObj.Value = ""
MsgBox "Phone Number is a required Field"
xObj.Focus
Exit Sub
End If
If Len(Trim(xTempNumber)) < 10 Then
xObj.Value = xTempNumber
MsgBox "Phone Number is required to be at least 10 characters."
xObj.Focus
Exit Sub
End IF
xObj.Value = "("
xObj.Value = xObj.Value & Mid(xTempNumber,1,3)
xObj.Value = xObj.Value & ") "
xObj.Value = xObj.Value & Mid(xTempNumber,4,3)
xObj.Value = xObj.Value & "-"
xObj.Value = xObj.Value & Mid(xTempNumber,7,4)
If Len(Trim(xTempNumber)) > 10 Then
xObj.Value = xObj.Value & " x"
xObj.Value = xObj.Value & Mid(xTempNumber,11)
End IF
End sub
-->
</script>
rob
|
|
|
 |
|