Comments

3 comments

  • Avatar
    Lucas

    Hi Jonathan,

    Can you help me get this working.  I understand what that p refers to the number of the item in the option list.

    And the i is the element number of the multi-select.

    I am using the following statement as a conditional statement to hide/show and element.

    getValueOfBitPosition(283035893,10)==1

    but it isnt working.

    Any ideas?

    Thanks

    Lucas

    0
    Comment actions Permalink
  • Avatar
    Jonathan Hsu

    Hey Lucas, glad to see this function getting a bit of use! From what you posted I think the problem is that your first argument when calling the function should be the element's name and not its ID. You'll want to refer to the element by its name, then the number of the option you're checking for.

    That being said, we've developed better ways to comb through a Multi-Select element. You can use the `ZCDisplayKey_` command to get a comma separated list of key values for a Multi-Select then use the method `indexOf()` to see if it exists in the list.

    Let's assume your Multi-Select element is called `reasons` and your key values match the Label text you posted above. The command `ZCDisplayKey_reasons.indexOf("Drowning") >= 0` would return true if Drowning was picked and false if it was not.

    Hope this helps!

    0
    Comment actions Permalink
  • Avatar
    Lucas (Edited )

    Thanks Jonathan,

    I'll give it a go.  Appreciate the help.

    Cheers

    Lucas

     

    ***UPDATE***

    Works great.  Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk