Format a number having a forward slash

(ferdinand) #1

Hi Folks,

I want to format a number in this format: 2019/4000. I do not want the user to type the forward slash but I want them to type the year before the forward slash and 4 digit number after it, Is there a way to have a slash as default? Iam using a number field and I must validate it so that the user doesn’t write a number with less or more than 4 digits.

Thanks in advance

(Clayton Sims) #2


CommCare doesn’t support Masked Text entry in the format you are describing.

As an alternative, you could collect the two fields the user would enter (enter with their own validation), concatenate them together into a hidden value which outputs the format you are describing, then display that formatted output ID string to the user if needed (or simply store it in the form data)