Viewing 5 reply threads
  • Author
    Posts
    • #639
      pers
      Member

      This on will not save, that is, when I choose left with document title and right with page number


      piklist( 'field', array(
      'type' => 'checkbox'
      , 'field' => 'checkbox_nested'
      , 'label' => 'Header'
      , 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
      , 'value' => array(
      'left'
      , 'right'
      )
      , 'choices' => array(
      'left' => 'Left: [field=checkbox_nested_select]'
      , 'center' => 'Center: [field=checkbox_nested_select]'
      , 'right' => 'Right: [field=checkbox_nested_select]'
      )
      , 'fields' => array(
      array(
      'type' => 'select'
      , 'field' => 'checkbox_nested_select'
      , 'value' => 'option4' // Sets default to Option 4
      , 'attributes' => array(
      'class' => 'text'
      )
      , 'choices' => array(
      'option1' => 'Document Title'
      , 'option2' => 'Site URL'
      , 'option3' => 'Site Title'
      , 'option4' => 'Page number'
      )
      ) )
      ) );

    • #640
      Steve
      Keymaster

      @pers– You can’t embed the same field (checkbox_nested_select) three times.  Create three separate fields. Fields, embedded or not, can only be used once per form.

    • #641
      pers
      Member

      Of course! .. and it works like a charm. thank you 🙂

    • #642
      Steve
      Keymaster

      @pers– Just a little trick.  If you want to keep all your lists absolutely the same, you can define the array first:

      $choices = array(
      'option1' => 'Document Title'
      , 'option2' => 'Site URL'
      , 'option3' => 'Site Title'
      , 'option4' => 'Page number'
      );

      And then include $choices in the field array:

      'choices' => $choices

      Makes it easier to manage all three lists.

    • #643
      pers
      Member

      Implemented, thanks 🙂

      Is it possible to have nested condtionals ? What I’d really like to have is “Custom text” in the select box, and if you choose that, you get a text field.

    • #644
      Steve
      Keymaster

      @pers– Currently, no. We are however, rethinking and rewriting the conditionals JS.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.