Tagged: ,

Viewing 1 reply thread
  • Author
    Posts
    • #7336
      mattkl
      Participant

      I had this working. Now, it isn’t. I’ve tried stripping everything out but this one group field. I have tried breaking each field out of the group. While I am sure there is a bug in how I have this set up, I am at a loss as to what the bug might be. The demo page for conditional field updates works fine (the demo in the Piklist Add-Ons).

      At one point it was working, and now for reasons I cannot identify, the updates are not working. No errors (that I can see, anyway). The number fields just don’t get updated when the selection changes.

      Am I doing something wrong?

      Here is the code of the select and number fields I am trying to manipulate using conditional updates:

      piklist('field', array(
      	'type' => 'group'
      	,'label' => 'Conditions Test'
      	,'description' => 'Select an option.'
      	,'fields' => array(
      		array(
      			'type' => 'select'
      			,'field' => 'ddlOptions'
      			,'label' => 'Select an option'
      			,'choices' => array(
      				'empty' => 'Choose'
      				,'option1' => 'option 1'
      				,'option2' => 'option 2'
      			)
      			,'value' => 'empty'
      			,'conditions' => array(
      				//option1
      				array(
      					'field' => 'numOne'
      					,'value' => 'option1'
      					,'update' => 1.00
      					,'type' => 'update'
      				)
      				,array(
      					'field' => 'numTwo'
      					,'value' => 'option1'
      					,'update' => 2.00
      					,'type' => 'update'
      				)
      				,array(
      					'field' => 'numThree'
      					,'value' => 'option1'
      					,'update' => 3.00
      					,'type' => 'update'
      				)
      				//option2
      				,array(
      					'field' => 'numOne'
      					,'value' => 'option2'
      					,'update' => 4.00
      					,'type' => 'update'
      				)
      				,array(
      					'field' => 'numTwo'
      					,'value' => 'option2'
      					,'update' => 5.00
      					,'type' => 'update'
      				)
      				,array(
      					'field' => 'numThree'
      					,'value' => 'option2'
      					,'update' => 6.00
      					,'type' => 'update'
      				)
      			)
      		)
      		,array(
      			'type' => 'number'
      			,'field' => 'numOne'
      			,'value' => 0
      			,'label' => 'Minimum'
      			,'columns' => 3
      			,'attributes' => array(
      				'min' => 0
      				,'step' =>.01
      			)
      		)
      		,array(
      			'type' => 'number'
      			,'field' => 'numTwo'
      			,'value' => 0
      			,'label' => 'Percentage'
      			,'columns' => 3
      			,'attributes' => array(
      				'min' => 0
      				,'step' =>.01
      			)
      		)
      		,array(
      			'type' => 'number'
      			,'field' => 'numThree'
      			,'value' => 0
      			,'label' => 'Flat Rate'
      			,'columns' => 3
      			,'attributes' => array(
      				'min' => 0
      				,'step' =>.01
      			)
      		)
      	)
      ));
    • #7337
      mattkl
      Participant

      OMG. Nevermind. The update values needed quotes. How did I miss that? KMN.

Viewing 1 reply thread
  • The topic ‘Conditional Updates based on Select option’ is closed to new replies.