Cognito Forms – Remove Commas from Number Field

cognito-forms

I have a Zip Code input box (just zip code alone, don't need other address field info) that was set up as a number field. As such, it inserts commas.

Is there some way to make it not use the commas? Looking at other answers I see it should have been set up as a Textbox field originally but unfortunately it's too late for that and we have numerous entries that have zip codes with commas in them.

Can we remove the commas?

If it's too late for existing submissions, I would like to at least prevent them from being entered going forward. Worst case, override the comma inserting so the user doesn't see the comma in their zip code when completing the form We can work around the commas after exporting on our end.

I expect changing it to a textbox field now would not be an option as it would not merge with the existing records, correct?

Best Answer

Yes the text field would be the way to go in your case.
I can see in some cases someone might want to put an extended zip code 29202-1234 and that wouldn't be handled at all in the numeric field.
I would be very careful however about deleting the existing number based field until you had exported all of your entries.

Once you delete a field from your form the corresponding data associated with that field will disappear as well.

One option to preserve the old zip codes would be to

  • Rename the zip code field to something else
  • Set the "show this field" option to Never on the renamed field
  • Then setup your new zip code field as text.

You would still end up with 2 columns of zip codes in your entries but at least you wouldn't lose the old data.
Personally I would download the entries, delete the existing entries, delete my old field and recreate the text field as the same name but I guess it depends on how you are managing the data from the forms.