Dropdown element

  • Views Views: 26,551
  • Last updated Last updated:

Navigation

      Access element (+)
      Birthday element
      Button element
      Calculation element
      Captcha element
      Checkbox element
      Colour Picker element
      Count element (+)
      Database join element
      Date element
      Digg element
      Display text element
      Dropdown element
      Facebook Like element
      Field element
      File Upload element
      Folder element
      Google Map element
      Image element
         Image databese join
      Internal id element
      IP element
      J!Date element
      Kaltura element
      Link element
      Notes element
      OpenStreetMap element
      Picklist element
      Radio Button element
      Rating element
      Sequence element
      Slider element
      Tags element
      Textarea element
      Thumbs element
      Time element
      Timer element
      Timestamp element
      Total element
      User element
      User group element
      Video element
      View level element
      YesNo element
      Youtube element
      Akismet validation
      Is Email validation
      Is Not validation
      Is Numeric validation
      Not empty validation
      PHP validation
      Rsa id
  • Settings
    dropdown.png


    Sub Elements​

    • Add - Press this to add in a new drop down option
    • Value - The value that is stored in the database if the drop down option is selected
    • Label - The label that appears next to the drop down option. Equally this label is shown in the table view rather than the recorded value (which is stored in the database table itself)
    • Default - is the option selected as default
    • Delete - Press this to delete the drop down option
    Note:You can reorder the sub Elements by clicking down on the grey bar to the left of the value field and dragging it within the list.

    Note: to create dropdown's with <optgroup>'s add a sub element with a value of '<optgroup>', the sub element label will be used as the dropdown optgroup heading. (since 25/11/2013)

    Options​

    • Multiple selections - if yes then uses can ctrl click to select multiple Options from the list
    • Multiple selections height - if multiple selections turned on then this value represents how many Options are visible in the list before you have to start scrolling it
    • Eval - evaluate the label as a PHP function.
    • Default - The default value to populate the element with. If the eval option is selected then this should contain a PHP statement

    Add Options​

    • Allow user to add drop down option - Allow your form's users to add in additional Options to your form.
    • Only add label - If no selected then the user has to enter both a value and a label for the checkbox option they are adding. If yes selected then only a label field is presented to the user the value of which is then used for the value and label.
    • Save new additions - If yes selected then the newly submitted option is stored by the element, meaning subsequent users of the form will be able to select the same value.

    Advanced​

    • Separator - to be completed
    • Eval Populate - Insert PHP code to build the Options. Should return an array of JHTML select Options. See sample below. Also on radio button element. Examples of use can be found there and below.
    • Eval - PHP Code to create Options, should return an array of JHTML select.Options. Get data from other Elements via $this->getFormModel()->data['table___element'] resp. $this->getFormModel()->data['table___element_raw']
    • Default - to be completed

    Sample Eval Populate

    Code:
    $Options[] = JHTML::_('select.option', '0', 'Please select' );
    $db = JFactory::getDbo();
    $db->setQuery("SELECT id, text FROM #__tablename");
    $rows = $db -> loadObjectList();
    foreach ($rows as $row) {
    $Options[] = JHTML::_('select.option', $row->id, $row->text);
    }
    return $Options;

    NOTE: Fabrik assumes the select IDs to be strings. Notice the first select option has the zero in quotes. Failing to do this will break the proper display of the value in a list view.
Back
Top