Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #2167
      Marcus
      Member

      I’m having a little bit of trouble with the following code:

      I’m creating a conditional section. That when I select ‘Refund’ from a previous drop down the following types show up.

      
      piklist('field' ,array(
      	'type' => 'group'
      	,'label' => 'Refund Info'
      	,'field' => 'mae_merch_pay_ri'
      	,'conditions' => array(
      		array(
      			'field' => 'mae_merch_pay_status'
      			,'value' => 'camps-refund'
      		)
      	)
      	,'fields' => array(
      		array(
      			'type' => 'checkbox'
      			,'field' => 'mae_merch_pay_cb'
      			,'label' => 'Cancel Bookings'
      			,'columns' => 4
      			,'value' => ''
      			,'choices' => array(
      				'y'=>'Yes'
      			)
      		)
      		,array(
      			'type' => 'select'
      			,'label' => 'Reason for Refund'
      			,'field' => 'mae_merch_pay_rfr'
      			,'columns' => 8
      			,'value' => ''
      			,'choices' => array (
      				'cancellation' => 'Cancellation'
      				,'adjustment' => 'Price Adjustment'
      				,'changecamp' => 'Changed Camps'
      				,'discount' => 'Discount'
      				,'testpurchase' => 'Test Purchase'
      				,'other' => 'Other'
      			)
      		)
      	)
      ));
      
      piklist('field', array (
      	'type' => 'group'
      	,'field' => 'mae_merch_pay_frfro'
      	,'label' => 'Fees and Misc'
      	,'conditions' => array(
      		array(
      			'field' => 'mae_merch_pay_status'
      			,'value' => 'camps-refund'
      		)
      	)
      	,'fields' => array (
      		array (
      			'type' => 'text'
      			,'label' => 'Fees'
      			,'field' => 'mae_merch_pay_rfees'
      			,'columns' => 3
      			,'value' => ''
      		)
      		,array (
      			'type' => 'text'
      			,'label' => 'Other Reason'
      			,'field' => 'mae_merch_pay_rfro'
      			,'columns' => 9
      			,'value' => ''
      			,'conditions' => array(
      				array(
      					'field' => 'mae_merch_pay_rfr'
      					,'value' => 'other'
      				)
      			)
      		)
      	)
      ));
      

      Problem is, all of them show up except for the last one, ‘mae_merch_pay_rfro’
      It’s conditional works simply, it shows if the previous drop down ‘mae_merch_pay_rfr’ is set to ‘other’.
      But no matter where I place this conditional and/or the type, inside the outer group, in a separate field, no matter what I do, it doesn’t work. (using 0.9.4.9)

      Hope you can help.

      Marcus

    • #2168
      Marcus
      Member

      My bad, close this ticket.

      I forgot, since its inside a named group, I use the ‘:’ to access the named group, then the inside field.
      So this worked perfectly:

      
      
      piklist('field', array (
      	'type' => 'group'
      	,'field' => 'mae_merch_pay_frfro'
      	,'label' => 'Fees and Misc'
      	,'conditions' => array(
      		array(
      			'field' => 'mae_merch_pay_status'
      			,'value' => 'camps-refund'
      		)
      	)
      	,'fields' => array (
      		array (
      			'type' => 'text'
      			,'label' => 'Fees'
      			,'field' => 'mae_merch_pay_rfees'
      			,'columns' => 3
      			,'value' => ''
      		)
      		,array (
      			'type' => 'text'
      			,'label' => 'Other Reason'
      			,'field' => 'mae_merch_pay_rfro'
      			,'columns' => 9
      			,'value' => ''
      			,'conditions' => array(
      				array(
      					'field' => 'mae_merch_pay_ri:mae_merch_pay_rfr'
      					,'value' => 'other'
      				)
      			)
      		)
      	)
      ));
      

      ‘field’ => ‘mae_merch_pay_ri:mae_merch_pay_rfr’
      Works perfectly. Sorry guys.

      Marcus

Viewing 1 reply thread
  • The topic ‘Named Groups’ is closed to new replies.