Tagged: add_more
- This topic has 10 replies, 3 voices, and was last updated 6 years, 1 month ago by
Marc.
-
AuthorPosts
-
-
May 20, 2014 at 8:23 am #1732
kattagamiMemberhello,
I notice diffrent issues with the add_more fields:
1- add_more doesn’t works with a html field.
piklist( 'field', array( 'type' => 'group', 'label' => 'Evaluation', 'field' => 'projets_evaluation_group', 'columns' => 12, 'add_more' => true, 'fields' => array( array( 'type' => 'html', 'value' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>', 'columns' => 12, ), array( 'type' => 'textarea', 'field' => 'projets_evaluation_comment_1', 'columns' => 12, ), array( 'type' => 'radio', 'field' => 'projets_evaluation_question_1', 'value' => '4', // Sets default to 4 'columns' => 12, 'choices' => array( '10' => 'tout à fait d\'accord', '8' => 'd\'accord', '6' => 'ni en désaccord ni d\'accord', '4' => 'pas d\'accord', '2' => 'pas du tout d\'accord', ) ), ) ) );2- If I put a textarea field to the end of an add_more group field, the textarea is not embed in the group fields.
piklist( 'field', array( 'type' => 'group', 'label' => 'Evaluation', 'field' => 'projets_evaluation_group', 'columns' => 12, 'add_more' => true, 'fields' => array( array( 'type' => 'radio', 'field' => 'projets_evaluation_question_1', 'value' => '4', // Sets default to 4 'columns' => 12, 'choices' => array( '10' => 'tout à fait d\'accord', '8' => 'd\'accord', '6' => 'ni en désaccord ni d\'accord', '4' => 'pas d\'accord', '2' => 'pas du tout d\'accord', ) ), array( 'type' => 'textarea', 'field' => 'projets_evaluation_comment_1', 'columns' => 12, ), ) ) );3- With repeating textarea, there are some differences in the way they are displayed.
piklist( 'field', array( 'type' => 'group', 'label' => 'Evaluation', 'field' => 'projets_evaluation_group', 'columns' => 12, 'add_more' => true, 'fields' => array( array( 'type' => 'textarea', 'field' => 'projets_evaluation_comment_1', 'columns' => 12, ), array( 'type' => 'radio', 'field' => 'projets_evaluation_question_1', 'value' => '4', // Sets default to 4 'columns' => 12, 'choices' => array( '10' => 'tout à fait d\'accord', '8' => 'd\'accord', '6' => 'ni en désaccord ni d\'accord', '4' => 'pas d\'accord', '2' => 'pas du tout d\'accord', ) ), ) ) ); -
May 20, 2014 at 10:25 am #1735
SteveKeymasterThis is a known bug > . Though Add-mores save data correctly, we are still working on presentation.
-
May 21, 2014 at 6:46 am #1739
kattagamiMemberYou’re right for the third point, I didn’t see this post 😉
And for the two first point:
1- add_more doesn’t works with a html field.
2- If I put a textarea field to the end of an add_more group field, the textarea is not embed in the group fields.Can you reproduce these bugs or is it specific to my environment?
-
June 7, 2014 at 10:38 am #1807
kattagamiMemberadd_more doesn’t works with a ‘File’ type field too.
So to recap, at the moment, we can’t use the following type fields in an add_more:
– Edit
– textarea
– html
– fileThese fields display outside the add-more box and don’t repeat when we click on the “+” button.
Hope you will find a solution to integrate these fields in add-more in the next release 😉 -
December 13, 2015 at 2:45 pm #5316
MarcMemberHi there,
Sorry to revive an old subject.
I’m trying to add a button field with add_more, but on pressing the + button, the javascript removes the value of the new button, hence removing its text.
I believe it would make sence to change in piklist.js line 1327if (!$(this).is(':checkbox, :radio')) { $(this).removeAttr('value'); }to
if (!$(this).is(':checkbox, :radio, :button')) { $(this).removeAttr('value'); }maybe even adding a class like .no-reset-on-repeat
if (!$(this).is(':checkbox, :radio, :button, .no-reset-on-repeat'))would allow flexibility for fields that could be repeated with the same value.Marc.
-
December 13, 2015 at 10:19 pm #5317
-
December 14, 2015 at 2:45 am #5319
MarcMemberI wasn’t, I was using 0.9.9.6
But after updating to 0.9.9.7, I encounter the same problem.
The value is correct if I save, but JS that duplicates the fields removes all values except for :checkbox and :radio, and not :button
piklst.js – line 1327if (!$(this).is(':checkbox, :radio')) { $(this).removeAttr('value'); }So if I add
:buttonafter:radio, it works perfectly.Attachments:
You must be logged in to view attached files.
-
-
December 14, 2015 at 12:51 pm #5332
-
December 14, 2015 at 1:15 pm #5339
MarcMemberHere it is:
piklist('field', array( 'type' => 'group' ,'field' => 'section_builder' ,'template' => 'field' ,'fields' => array( array( 'type' => 'group' , 'field' => 'section_group' , 'add_more' => true , 'fields' => array( array( 'type' => 'button' ,'field' => 'section_add_btn' ,'label' => 'A label' ,'attributes' => array( 'value' => 'The Button' ,'class' => 'button' ) ) , array( 'type' => 'hidden' ,'field' => 'section' ) ) ) ) ));I tried with the button field on its own and add more and the same happens:
piklist( 'field', array( 'type' => 'button' ,'field' => 'section_add_btn' ,'label' => 'Add a section' ,'add_more' => true ,'attributes' => array( 'class' => 'button' ) ) );The JS code in piklist/parts/js/piklist.js clearly removes the value parameter.
This file piklist/parts/js/piklist.js downloaded from the trunk says it’s been modified in october. So maybe something is not up to date? -
December 14, 2015 at 1:33 pm #5340
MarcMemberI wanted to create a custom field with some custom JS and functions, but when I tried something simple the add_more didn’t work. So I tried with the already existing fields.
-
December 14, 2015 at 2:00 pm #5341
MarcMemberI just had an idea and tried this instead, in a custom field:
<a href="#" class="button">My button</a> <input type="hidden" id="<?php echo piklist_form::get_field_id($arguments); ?>" name="<?php echo piklist_form::get_field_name($arguments); ?>" value="<?php echo esc_attr($value); ?>" <?php echo piklist_form::attributes_to_string($attributes); ?> />A button (not as a input) and a hidden input.
The repeater works well, and it will probably allow me to do what I need to.
-
-
AuthorPosts
- You must be logged in to reply to this topic.


