Re: Normalizing Dates and Phone numbers

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 26728
interpreted = N
texte = At 9:26 PM -0800 2000/01/29, Chuck Rice wrote:>At 5:00 PM -1000 2000/01/29, Kenneth Grome wrote: > >>Here, use this database with the convertchars context. It will get rid of everything that's not a number, then you can format the resulting string of digits with some getchars contexts ... or you can leave the resulting string as it is, which will result in 4085551212 based on your examples above: > >Thanks! Here is what I came up with. Seems to handle most cases. -Chuck- > >[!] >[\!][GetChars start=8&end=10&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]-[!] >[\!][GetChars start=5&end=7&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]-[!] >[\!][GetChars start=1&end=4&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]Ok, Now I am confused again. The above works for output, but I need to process the input from a field before it gets written to the database.I put the above code in an include file called -NormalizePhone and set it up so I could invoke it with: [include file=-NormalizePhone&var1=[HPhone]]My input field is in a form Which then invokes a completion routine that has:[showif [action]=Replace][replace db=AddressBook.db&eqSKUdatarq=[url][sku][/url]] [!] [\!][formvariables name=_&exact=F][getchars start=2][name][/getchars]=[url][value][/url]&[/formvariables] [!] [\!][/replace]
Record Replaced

[commitdatabase db=AddressBook.db] [/showif]In it. Where do I put the include to change the phone number? It seems to be in the formvariables. Something is not adding up here. I must be missing something basic. -Chuck-__________________________________________________________________________ Chuck Rice ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: Normalizing Dates and Phone numbers (Chuck Rice 2000)
  2. Re: Normalizing Dates and Phone numbers (Kenneth Grome 2000)
  3. Re: Normalizing Dates and Phone numbers (Chuck Rice 2000)
  4. Re: Normalizing Dates and Phone numbers (Chuck Rice 2000)
  5. Re: Normalizing Dates and Phone numbers (Kenneth Grome 2000)
  6. Re: Normalizing Dates and Phone numbers (Aaron Lynch 2000)
  7. Normalizing Dates and Phone numbers (Chuck Rice 2000)
At 9:26 PM -0800 2000/01/29, Chuck Rice wrote:>At 5:00 PM -1000 2000/01/29, Kenneth Grome wrote: > >>Here, use this database with the convertchars context. It will get rid of everything that's not a number, then you can format the resulting string of digits with some getchars contexts ... or you can leave the resulting string as it is, which will result in 4085551212 based on your examples above: > >Thanks! Here is what I came up with. Seems to handle most cases. -Chuck- > >[!] >[\!][GetChars start=8&end=10&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]-[!] >[\!][GetChars start=5&end=7&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]-[!] >[\!][GetChars start=1&end=4&from=end]00000000000[ConvertChars db=Strip.db][var1][/ConvertChars][/GetChars]Ok, Now I am confused again. The above works for output, but I need to process the input from a field before it gets written to the database.I put the above code in an include file called -NormalizePhone and set it up so I could invoke it with: [include file=-NormalizePhone&var1=[HPhone]]My input field is in a form Which then invokes a completion routine that has:[showif [action]=Replace][replace db=AddressBook.db&eqSKUdatarq=[url][sku][/url]] [!] [\!][formvariables name=_&exact=F][getchars start=2][name][/getchars]=[url][value][/url]&[/formvariables] [!] [\!][/replace]
Record Replaced

[commitdatabase db=AddressBook.db] [/showif]In it. Where do I put the include to change the phone number? It seems to be in the formvariables. Something is not adding up here. I must be missing something basic. -Chuck-__________________________________________________________________________ Chuck Rice ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Chuck Rice

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Unique SKU Numbers (2000) Re1000001: Setting up shop (1997) [OT] Airport Network (2003) Forumulas.db & Variables (2002) WCS Newbie question (1997) Emailer setup (1997) RE: Subtotal help (1997) formvars available in formulas.db? (2000) WebCat2 - [SendNews] (1997) [format] problem (2001) Test (2003) apache and webcatalog under win98 (2001) Hiding URL ? (1998) What am I missing (1997) WebCommerce: Folder organization ? (1997) [WebDNA] Fresh Snow Leopard install (2009) Looking for work (2001) UPDATE PROBLEM (1997) Hard Questions ? (1997) WebCat2 several catalogs? (1997)