Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @juniorjlk

    Thank you very much for using our plugin.

    The plugin includes two alternatives to add the dropdown choices in bulk:

    * Use the DropDown DS fields, distributed with the Developer and Platinum versions, and reading the choices’ texts and values from a CSV file. This method has the advantage of using the same CSV file with multiple forms to update every form from only one place, the CSV file.

    For example, assuming you send your products to a list of countries and allow the users to select the country for shipping through a DropDown field. If you want to add a new country to the list, you must edit every form separately. But using DropDown DS fields, you only need to add the country to the CSV file.

    https://cff.dwbooster.com/blog/2019/02/14/ds

    * The second alternative would be to populate the DropDown field by coding. For example, assuming you have the DropDown field fieldname123, and you want to add the following choices:

    First choice:
    Text: A
    Value: 1

    Second choice:
    Text: B
    Value: 2

    Third choice:
    Text: C
    Value: 3

    Insert an “HTML Content” field in the form and enter the following piece of code as its content:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    getField('fieldname123').setChoices({'texts' : ['A', 'B', 'C'], 'values': [1, 2, 3]});
    });
    </script>

    Best regards.

    Thread Starter juniorjlk

    (@juniorjlk)

    thanks

    how can i keep option “Select2 library ” using option via HTML?

    Plugin Author codepeople

    (@codepeople)

    Hello @juniorjlk

    Please, edit the piece of code as follows:

    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function () {
        var $ = fbuilderjQuery,
            f = getField('fieldname123'),
    	e;
    
        f.setChoices({
            'texts': ['A', 'B', 'C'],
            'values': [1, 2, 3]
        });
        e = f.jQueryRef().find('select');
        e.next('.cff-select2-container').remove();
        e.after('<span class="cff-select2-container"></span>');
        e.on('change', function () {$(this).valid();});
        e.select2({'dropdownParent': e.next('.cff-select2-container')});
    });
    </script>

    Best regards.

    Thread Starter juniorjlk

    (@juniorjlk)

    perfect, thank you!

    Plugin Author codepeople

    (@codepeople)

    Hello @juniorjlk

    The additional code won’t be necessary for the next plugin update.

    Best regards.

    Thread Starter juniorjlk

    (@juniorjlk)

    Is there any limitation of texts and values in the script option via HTML?

    Thread Starter juniorjlk

    (@juniorjlk)

    I already noticed that there is no limitation, I just made a mistake. Thanks again

    Plugin Author codepeople

    (@codepeople)

    Excellent !!!

    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘bulk values dropdown’ is closed to new replies.