Announcement

Collapse
No announcement yet.

Is it possible to list all of the choices for avariable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is it possible to list all of the choices for avariable?

    Hi - I have created a variable with a list of choices. Is it possible to list all of the choices for that variable?

    I want to use these choices in a drop-down field on a form.
    Regards
    David

    #2
    I don't think so. You could however create a few separate variables as the list options and place them in the layout code so as to populate a dropdown list which would then be uploaded.

    Comment


      #3
      Alternatively, do as Duncan suggests but put all your choices into a single variable, separating them with e.g a comma. Then use a tiny bit of PHP to split out the names and generate the list.
      Code:
      <actinic:block php="true">
      foreach (split(',', '<actinic:variable name="MyChoices" encoding="perl" selectable="false" />') as $item) echo "<option value="$item">$item</option>";
      </actinic:block>
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        So simple, but so effective, php just rocks the more and more i see it! Nice one Norman.

        Comment


          #5
          Thanks for the replies guys - I agree regarding PHP - so powerful!!!!
          Regards
          David

          Comment

          Working...
          X