I have a requirement where in a text field needs to be formatted in a specified format of "X.1234567"

I have a requirement where in a text field needs to be formatted in a specified format of "X.1234567", where 'X' and '.' will be a constant followed by 7 digits.
If we are typing 123 in the text field, it should be formatted to "X.0000123". 

Any help would be appreciated.

Thanks!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    What will the user standardly be expected to type? What range of allowed input will there be?  Is the text following "X." only ever going to be essentially an integer?

    Will the formatted value of "X.0000001" etc be for display purposes only or would we want the *actual stored* value to reflect that text as well?

  • Users may type any characters or numbers then that should be taken care with validation messages, but when numbers are entered, it should be formatted as "X.seven digits",
    scenario1 : If user has entered 123 in the fiels, then formatting should make the field value as "X.0000123"
    scenario 2: If user has entered 1234567, the formatting should make the field value as "X.1234567"
    Anything apart from this, should throw validation error.

  • Also, Will the formatted value of "X.0000001" etc be for display purposes only or would we want the *actual stored* value to reflect that text as well? ---> Formatted value should be for display in the text field and separately this has already been taken care at back end as we are using external database.

Reply Children
No Data