Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 24th, 2004, 08:42 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default Phone Number validation help.

Just starting to really get into hand coded form validation.

I have this bit of code that does a fairly good job. I just want to make the phone number validation so that people can use a hyphen when they type a phone number. Can anyone show me how or help me with it.
Code:
<script language=vbscript>
Sub btnSubmit_OnClick()
    If isdate(honotice.txtlossdate.value) = 0 Then
        Alert "You must enter a loss date. If you do not know the loss date please call 1-800-000-0000"
        honotice.txtlossdate.focus
        Exit Sub
    ElseIf  Len(honotice.txtinsuredname.value) <2 or IsNumeric(honotice.txtinsuredname.value)then
        Alert "You must enter the insured. If you do not know the insured name please call 1-800-000-0000"
        honotice.txtinsuredname.focus
        Exit Sub
    ElseIf Len(honotice.txtpolicynumber.value) = 0 Then
        Alert "You must enter the policy number. If you do not know the policy number please call 1-800-000-0000"
        honotice.txtpolicynumber.focus
        Exit Sub    
    ElseIf isdate(honotice.txtpolicyeffectdate.value) = 0 Then
        Alert "You must enter a policy effective date. If you do not know the policy effective date please call 1-800-000-0000"
        honotice.txtpolicyeffectdate.focus
        Exit Sub
    ElseIf Len(honotice.txthomephone.value) <2 or Not IsNumeric(honotice.txthomephone.value) then
        Alert "You must enter a phone number. If you do not have a phone please call 1-800-000-0000"
        honotice.txthomephone.focus
        Exit Sub            
    End If
    Call honotice.submit()
End Sub
</script>
Since I'm asking I would also like to control the date range for the dates. Say it would only take a date before or after a specific date.

Thanks!

Reply With Quote
  #2 (permalink)  
Old July 25th, 2004, 06:39 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I posted this in this forum by mistake.
I would like to ask a moderator to remove it.
I've posted it in the VBscript forum and don't want to appear that I've posted it in 2 places intentionally.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
Getting mobile phone number yukijocelyn C# 2005 0 May 28th, 2008 11:43 PM
phone number brackets dhoward VB.NET 2002/2003 Basics 1 November 8th, 2006 11:58 AM
phone number validation debjanib ASP.NET 1.0 and 1.1 Professional 0 June 6th, 2006 12:01 PM
reformat phone number netcrawler Classic ASP Databases 1 November 3rd, 2004 09:01 PM



All times are GMT -4. The time now is 05:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.