Okay
  Public Ticket #868965
Modal
Closed

Comments

  •  2
    Rodolfo started the conversation

    Hello ,

    I'm having trouble adding selection fields " selectbox " in modals . The same does not display the field.

    http://connectprime.com.br/call/ui-modals.html

    Click in "Show Me" on Responsive Modal

    Thanks

  • [deleted] replied

    Hi Rodolfo,

    After initiating the modal pop up, please execute this JavaScript:

    $("select.selectboxit").each(function(i, el)
    {
    var $this = $(el),
    opts = {
    showFirstOption: attrDefault($this, 'first-option', true),
    'native': attrDefault($this, 'native', false),
    defaultText: attrDefault($this, 'text', ''),
    };

    $this.addClass('visible');
    $this.selectBoxIt(opts);
    });
    This will render select boxes properly.
  •  2
    Rodolfo replied

    Hi!

    Not work.. 

    Error: 'attrDefault is not defined'

  • [deleted] replied

    Hi Rodolfo,

    Include in that code the following function so it should be something like this:

    // Element Attribute Helper
    function attrDefault($el, data_var, default_val)
    {
        if(typeof $el.data(data_var) != 'undefined')
        {
            return $el.data(data_var);
        }
        return default_val;
    }
    $("select.selectboxit").each(function(i, el)
    {
       var $this = $(el),
              opts = {
                        showFirstOption: attrDefault($this, 'first-option', true),
                      'native': attrDefault($this, 'native', false),
                          defaultText: attrDefault($this, 'text', ''),
                    };
          $this.addClass('visible');
      $this.selectBoxIt(opts);
    });

    And check if it works for you?

  •  2
    Rodolfo replied

    $this.selectBoxIt is not a function

    Hiho.. 

  • [deleted] replied

    Can you please give me the URL of this page and tell me how to access the form issue?

  •   Rodolfo replied privately
  • [deleted] replied

    Hi Rodolfo,

    After the modal is displayed with the fields, please call this function:

    selectBoxItFields();

    It will render selectboxit field, just don't forget to add the class "selectbox it" to select elements currently containing only "form-control" class.