SerializeJSON turning 08690 into 8690.. Help!

I am using jquery autosuggest and it uses JSON to give the zipcodes as i type.   The zipcodes are right in the database

as 00620, 08690, etc,etc.  But the JSON is dropping the leading zeros.   How can I make it stay as a full string and not make it a number?
theideabulbAsked:
Who is Participating?
 
_agx_Commented:
Sounds like it's converting it to a numeric type (which doesn't have leading zeros). Last I checked, the only hack was to add a leading or trailing space to the value. That tricks json into thinking the value is a string, not a number.

ie    
"(space)00620"  OR
"00620(space)"
0
 
gdemariaCommented:
Not sure about the jquery part, but in your SQL you can left pad with zeros...

WHERE ZIPCODE = #right('00000' & form.zipcode,5)#
0
 
theideabulbAuthor Commented:
Crazy, but this fixed it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.