View Full Version : zip code in database

11-10-2007, 02:25 AM
Hi all,

I just noticed that some US east coast zip codes that begin with zero, have the zero dropped in my table. Will this appear as a 4 digit number if someone retrieves info in a search? Or is the zero just not visible in MyAdmin?

11-10-2007, 07:56 AM
If you have set the zip code as number field, zeros at the begining are trimmed off. Set the ZIP code as text and not as number. In many countries zip contains also letters.

You need to change both the field type in your form, AND the field type in your database table.

11-10-2007, 12:31 PM
Thanks Naval.

Another question: I've seen in the phone number field of forms set up where the brackets for area codes and hyphens are set as initial values, like this; (___)-___-____ , and the cursor moves as user enters the correct amount of numbers. Is this a difficult trick?

11-10-2007, 12:42 PM
It requires custom Javascript, so it is not an easy task.