2 Replies Latest reply on Apr 21, 2017 7:36 AM by ammeling10596437

    Trying to obtain zip codes beginning with 0


      I'm trying to create an app that involves getting a zip code from the user, and then returns the corresponding latitude and longitude coordinates. I created an input text field for the user to enter a 5-digit zip code, and two text fields that display latitude/longitude. I'm pulling data from an xml file that contains nothing but zip codes and coordinates. So far, it runs perfectly for any zip codes not beginning in 0. But if the user were to enter a zip code beginning with one or more zeroes, such as "00987", the number returned is "987". Since that isn't a valid zip code, the latitude and longitude both return 0.


      I could post my entire code but I'm not sure that's necessary, it seems more like I just don't understand how input text fields work, or I'm using the wrong method when parsing the user's input. I'm using a number variable for the zip code called myZip, and then using "myZip = parseFloat(zipCodeField.text);" to retrieve the number in the input text field.


      Any help is really appreciated, I'm still quite new to Animate and coding so I'm not up to snuff on this kind of stuff yet.