View Single Post
  #7 (permalink)  
Old July 26th, 2004, 12:58 PM
mar0364 mar0364 is offline
Authorized User
 
Join Date: Jul 2003
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once again thanks! I broke it down to a one field form and got it to work. How do I intigrate it with the sub? Do I need to work on the elseif structure. Going to read about that now.
Code:
<script language="VBScript" type="text/vbscript">
Sub btnSubmit_OnClick()

Dim objregx
set objregx = New RegExp
objregx.pattern = "(1-)?\d{3,}-\d{3,}-\d{4,}"

if (objRegx.test(honotice.txthomephone.value)) then
    else
        Alert "You must enter a proper phone number example 305-555-1212. If you do not have a contact number please call 1-800-882-3054"
honotice.txthomephone.focus
    Exit Sub
    End If
    Call honotice.submit()
End Sub

</script>
Thanks!
Rich

Reply With Quote