Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Formating Phone Numbers in Forms
On Fri, 26 Jun
>I'm trying to format phone numbers in my forms. My problem is trying to
>allow for both US and non-US phone numbers. How do I check for the
>various types of non-US phone number formats? Hope this is specific
>enough.
>
Tijuana Glover,
I'm not sure if you're trying to determine what the format should be based upon the phone number entered, or if you're trying to set the format based upon some other value, i.e. country.
If the latter and knowing what the country is, you could use the set_item_property to set the format to what is appropriate. For example using the USA:
set the data type of the field to number use a when-new-item-instance to set the format to null:
set_item_property('block.field',format,'');
use post-text-item to set the format based upon the country:
IF country = 'USA' THEN set-item-property('block.field',format,"("999")" 999"-"9999 ELSIF country = 'whatever...' THEN . . . END IF;
When the cursor enters the field, there is no format allowing the user to enter a continuous string of numbers. On leaving the field it will be appropriately formatted for each country.
You could also do this with a database package procedure with a table of various formats to be returned and applied in the set_item_property. If this is something you could use, email me and I'll send you a copy of the package procedure.
Hope this helps
Milt Peterson
To email me remove the 'xspam' from my address. Sorry for the inconvenience. Received on Fri Jul 03 1998 - 00:00:00 CDT
![]() |
![]() |