Viewing 1 reply thread
  • Author
    Posts
    • #3958
      fredpik
      Member

      Hi,
      I’m trying to update several fields at once with the ‘conditions’ parameter, but it doesn’t work.

      
      piklist('field', array(
                  'type'          => 'checkbox',
                  'field'         => 'testmode',
                  'label'         => __( 'Test mode' ),
                  'description'   => __( 'Please check informations below' ),
                  'choices'       => array(
                      'true'   => __( 'Enabled' )
                  ),
                  'conditions'    => array(
                      array(
                          'type'      => 'update',
                          'value'     => 'true',
                          'field'     => 'field1',
                          'update'    => 'value1'
                      ),
                      array(
                          'type'      => 'update',
                          'value'     => 'true',
                          'field'     => 'field2',
                          'update'    => 'value2'
                      )        
                  )
      ));
      piklist('field', array(
                  'type'      => 'text',
                  'label'     => 'label1',
                  'field'     => 'field1',
      ));
      piklist('field', array(
                  'type'      => 'text',
                  'label'     => 'label2',
                  'field'     => 'field2',
      ));
      

      Am I missing something?
      Is there a way to achieve this result?

      Thanks

    • #3962
      Steve
      Keymaster

      @fredpik– Not sure if you found a bug, or this is a feature request… either way, it doesn’t seem to work.

      Not sure if this would help, but you can always fill in that field by retrieving the data from the database. It would require a page save. Not sure if that would work for you. Let me know if you need any help with that.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.