Skip to main content
Known Participant
Feb 27, 2019 9:42 AM UTC
Question

Valid values in varoables (TEB's)

Hi,

i have a advanced function that validates user inputs inside different TEB's.

The right value at one of the TEB's should be "060" and if its typed in right, a icon should be displayed. Problem is that the value will not validate correctly. I have a few more TEB's were the right values start with "0" (016, 0500) and they are also not validated correctly. Does Captivate variables misinterpret the "0" infront of numbers?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Inspiring
    Feb 27, 2019 1:38 PM UTC

    Lilybiri is correct - you would need to use JS to validate any number starting with a zero, or any number with a decimal point and ending with a zero (e.g., 6.50).

    Translate
    Lilybiri
    Legend
    Feb 27, 2019 9:55 AM UTC

    The way numeric values are treated in Captivate can be weird indeed, since you cannot define the type of the variable (number or string).

    I cannot explain, but only offer a workaround which I always use in this case: put the correct number in a snother user variable and use that one in the condition. Probably switching to JS would be a better solution, but I am bit lazy...

    Translate
    mhhwnAuthor
    Known Participant
    Feb 27, 2019 11:57 AM UTC

    I've tried it and it didn't work, but i've chosen "60" as value now and if i type in "060" it is displayed as correct. Think i can work with that.

    It seems that Captivate totally ignores the first zero. I also have a TEB with the right value "000", if the TEB is empty it is displayed as correct aswell.

    Translate
    Lilybiri
    Legend
    Feb 27, 2019 12:54 PM UTC

    Hmmm, that works for me. How did you set up the action?

    Translate