Validation

Hi Team,

Validation should be triggered if the user enters two consecutive dots in the text field. How can we handle this?

  Discussion posts and replies are publicly visible

Parents
  • The validation should throw an error when the user enters something like "3.6.5" as an example. how can we achive this?

  • 0
    Certified Lead Developer
    in reply to sid
    The validation should throw an error when the user enters something like "3.6.5" as an example

    that is different than what you originally said ("two consecutive...")

    it is important to be completely clear with your requirements before you post a question if you want something that will handle the various cases you require.  Otherwise you'll get a solution suggestion that handles ".." but doesn't handle "3.6.5" as you've seen.

    So is your requirement "can only have up to one decimal"?  or is it "has to have exactly one decimal, no more and no less"?  These are implemented differently, obviously.

    Something I've used in the past when I need to verify exactly one period, for example, would be like <<length(split(ri!string, ".")) = 2>> meaning, if i split the string into an array of strings on the "." character, there should be exactly 2 members of the array (a part of the string before it and a part of the string after it).  Note you'd need to do some extra work to ensure the other parts are numeric, if that's what you're after.

Reply Children
No Data