Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Conditions in add more groups #2661
    atanas
    Member

    Hi steve,

    In the add more are the fields:

    Country – a select field
    Fruits – a select field
    Organges and apples – select fields with a condition based on the above fruits field ( is user selects organges as the fruit, we show the varieties of organges, if they select apples, we show the varieties of apples)

    Outside of the add more is the shipping field

    Thanks
    Atanas

    in reply to: Custom save/load #2660
    atanas
    Member

    Hi steve,

    Originally I asked about a custom save/load since sub groups do not work. You suggested I use a group to have all the data saved in a single record, and that is why I posted the code to help you see the issues. Either of the solutions (custom save/load put all fields in a master group) would be ok, even though with too many fields it will be a burden to have them in a single file i order to use a mater group.

    Thanks
    Atanas

    in reply to: Custom save/load #2657
    atanas
    Member

    Hi Steve,

    Just in case, here is also the code when the shipping is ungrouped and saves in a separate postmeta, if it can also help nail down the issues

    piklist('field',
    		array('type' => 'group',
    		      'label' => 'Fruits',
    		      'add_more' => true,
    		      'description' => 'Select a fruit.',
    		      'fields' => array(
    			      array(
    				      'type' => 'select',
    				      'field' => 'country',
    				      'label' => 'Country',
    				      'value' => 'US',
    				      'columns' => 4,
    				      'choices' => array(
    					      'US' => 'United States',
    					      'EU' => 'European Union'
    				      )
    			      ),
    
    			      array(
    				      'type' => 'select',
    				      'field' => 'fruits',
    				      'label' => 'Fruits',
    				      'value' => 'apples',
    				      'columns' => 12,
    				      'choices' => array(
    					      "apples" => "Apples",
    					      "oranges" => "Oranges",
    				      )
    			      ),
    
    			      array(
    				      'type' => 'select',
    				      'field' => 'apples',
    				      'label' => 'Apples',
    				      'columns' => 12,
    				      'value'   => 'post_title',
    				      'choices' => array(
    					      "aceymac" => 'Aceymac  apple',
    					      "akero" => 'Akero  apple',
    				      ),
    				      'conditions' => array(
    					      array(
    						      "reset" => false,
    						      'field' => 'fruits',
    						      'value' => "apples"
    					      ),
    
    				      )),
    			      array(
    				      'type' => 'select',
    				      'field' => 'oranges',
    				      'label' => 'Oranges',
    				      'columns' => 12,
    				      'choices' => array(
    					      "blood" => "Blood Orange",
    					      "navel" => "Navel Orange"
    				      ),
    				      'conditions' => array(
    					      array(
    						      "reset" => false,
    						      'field' => 'fruits',
    						      'value' => "oranges"
    					      ),
    
    				      )),
    		      ),
    	)
    );
    
    piklist('field',
    		      array(
    			      'type' => 'select',
    			      'field' => 'shipping',
    			      'label' => 'Shipping',
    			      'columns' => 4,
    			      'choices' => array(
    				      ''          => '',
    				      'ground'  => 'Ground',
    				      'UPS'    => 'UPS',
    			      )
    
    		      )
    );
    
    in reply to: Custom save/load #2654
    atanas
    Member

    Hi Steve,

    I posted the sample code in the other thread, I am attaching here two screen shots – how the fields should look (the shipping field needs to be outside of the add more), and how they look if they are all bundled together in one group so the data is saved in one postmeta.

    Thanks,
    Atanas

    Attachments:
    You must be logged in to view attached files.
    in reply to: Conditions in add more groups #2653
    atanas
    Member

    Hi Steve,

    Here is the code that demonstrates both the conditions in add more (if you have more than one addmore, selecting a fruit in one of them will force display the corresponding fruits in all of the add mores) and the misalignment when trying to put all the fields in one group (besides the conditions do not work when in a sub-group)

    
    piklist('field',
    	array('type' => 'group',
    	      'label' => 'Settings',
    		   "field" => "settings",
    	      'description' => 'Main Settings Field',
    	      'add_more' => false,
    	      'fields' => array(
    		array('type' => 'group',
    		      'label' => 'Fruits',
    		      'add_more' => true,
    		      'description' => 'Select a fruit.',
    		      'fields' => array(
    			      array(
    				      'type' => 'select',
    				      'field' => 'country',
    				      'label' => 'Country',
    				      'value' => 'US',
    				      'columns' => 4,
    				      'choices' => array(
    					      'US' => 'United States',
    					      'EU' => 'European Union'
    				      )
    			      ),
    
    			      array(
    				      'type' => 'select',
    				      'field' => 'fruits',
    				      'label' => 'Fruits',
    				      'value' => 'apples',
    				      'columns' => 12,
    				      'choices' => array(
    					      "apples" => "Apples",
    					      "oranges" => "Oranges",
    				      )
    			      ),
    
    			      array(
    				      'type' => 'select',
    				      'field' => 'apples',
    				      'label' => 'Apples',
    				      'columns' => 12,
    				      'value'   => 'post_title',
    				      'choices' => array(
    					      "aceymac" => 'Aceymac  apple',
    					      "akero" => 'Akero  apple',
    				      ),
    				      'conditions' => array(
    					      array(
    						      "reset" => false,
    						      'field' => 'fruits',
    						      'value' => "apples"
    					      ),
    
    				      )),
    			      array(
    				      'type' => 'select',
    				      'field' => 'oranges',
    				      'label' => 'Oranges',
    				      'columns' => 12,
    				      'choices' => array(
    					      "blood" => "Blood Orange",
    					      "navel" => "Navel Orange"
    				      ),
    				      'conditions' => array(
    					      array(
    						      "reset" => false,
    						      'field' => 'fruits',
    						      'value' => "oranges"
    					      ),
    
    				      )),
    		      ),
    			),
    		      array(
    			      'type' => 'select',
    			      'field' => 'shipping',
    			      'label' => 'Shipping',
    			      'columns' => 4,
    			      'choices' => array(
    				      ''          => '',
    				      'ground'  => 'Ground',
    				      'UPS'    => 'UPS',
    			      )
    
    		      ),
    
    	    ),
    	)
    );
    
    in reply to: Add more and javascript #2652
    atanas
    Member

    Steve – any chance this is related to my issue? The conditions in add more groups are getting attached to all the “mastr” fields, so as soon as you have more than one add more, changing the vakue in one of the add mores triggers the conditions on all of the add mores?

    Thanks
    Atanas

    in reply to: Custom save/load #2651
    atanas
    Member

    Thanks Dteve,

    Tried to put them in a group with all sort of issues came with sub grouos in the group – the fields and labels are mis-aligned. I will post the code on the othe thread, as it shows the issue with both the conditions and mis alignment, or do you want me to post here?

    Thanks
    Atanas

Viewing 7 posts - 1 through 7 (of 7 total)