Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37683

Select materialize.

Newsgroups comp.lang.javascript
Date 2019-11-03 06:43 -0800
Message-ID <82d2014b-d33e-4a97-a7fe-a04ee63bdc3c@googlegroups.com> (permalink)
Subject Select materialize.
From coutinho.elias@gmail.com

Show all headers | View raw


Good morning my friends,

I have the following code that I took from an example on the internet:

https://gsm-gervas.s3.amazonaws.com/static/js/jquery.formset_material.js

It is working perfectly but as the creator did not anticipate I am using materialize and when I create a new form (Function of the code) it does not take the js call of the function that is:

  $ ('select'). material_select ();

That is, without the above call my selects do not work, tried to include but did not find suitable place for it.

I wonder if any friends can help me

I have two calling options:

   document.addEventListener ('DOMContentLoaded', function () {
     var elems = document.querySelectorAll ('select');
     var instances = M.FormSelect.init (elems, options);
   });

   // Or with jQuery

   $ (document) .ready (function () {
     $ ('select'). formSelect ();
   });

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Select materialize. coutinho.elias@gmail.com - 2019-11-03 06:43 -0800

csiph-web