Timmer
|
| Posted: 09/08/2005, 8:14 PM |
|
I have a db field for telephone number and and the field marked as follows:
Type: text
Format: (000) 000-0000
MySQL set to text 10 max varchar
Want to store as 10 digit numeric value, but it is storing the value as (818) 998-
How can I fix this?
What are values for DBFormat ? (have seen lots of date formats for the DBFormat property but not strings)..
Thanks,
Timmer
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 09/09/2005, 10:51 AM |
|
I think that text fields cannot be formatted 2-way, only dates and numeric. Therefore if you like to use formatting then you could set the format to "(000) 000-0000" and change the database field type to numeric, like Integer or Longint. Then also change the control type to integer.
Alternatively you can re-format the text before updating the database.
Also, take a look at how to use input masking, as shown in the "Data Entry with Input Mask" example: http://examples.codecharge.com/ExamplePack/InputMask/InputMask.php. This won't solve your problem and you may still need to reformat the text, but it's just another approach to formatting text.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|