Skip to main content
shobhits0002
August 23, 2022
Solved

formatting should be 7 digits + a space + 4 digits = 11 digits with a space in the middle. e.g. 1234567 1234

  • August 23, 2022
  • 3 replies
  • 0 views

I have a requirement for formatting the field where it should be  of 7 digits + a space + 4 digits = 11 digits with a space in the middle. e.g. 1234567 1234.

Any help will be appreciated.

Thanks,

Shobhit

    Best answer by deepakg681722

    Try this one.

    text(
    "12345678901",
    "####### ####"
    )

    3 replies

    stewart.burchell
    August 23, 2022

    You can use the like() function. Something like this seems to meet your requirements:

    fn!like(
      ri!input,
      "[1-9][1-9][1-9][1-9][1-9][1-9][1-9] [1-9][1-9][1-9][1-9]"
    )

    (note that there is a space between the first group of seven [1-9] and the last group of four [1-9]. Also note that if you want to allow a zero in either of your groupings of digits you can adjust the relevant [1-9] to [0-9] as required)

    ...where ri!input is a text field.

    shobhits0002
    August 23, 2022

    Hi Stewart,

    Thanks for your reply. But, this won't format the values entered in the field as required.

    August 23, 2022

    Try this one.

    text(
    "12345678901",
    "####### ####"
    )