Category : materialize

I have two Materialize datepickers <input class="datepicker" id="start" type=text value="2021-05-12"/> <input class="datepicker" id="end" type=text value="2021-05-25"/> I want for goth of them dynamically set minDate and maxDate. In pure javascript. I initalize them in a loop var elems = document.querySelectorAll(‘.datepicker’); elems.forEach(e => { console.log(e.id) datePicker[e.id] = M.Datepicker.init(elems, datepickerOptions); }) but then I do not know how ..

Read more

I wonder I can change the content of Materialze div class datepicker-date-display Format from options like format: ‘yyyy-mm-dd’ would be nice or even hiding the class might be better than what is there now. Working jsFiddle I am using Materialize 1.0 var datepickerOptions ={ format: ‘yyyy-mm-dd’, autoClose : "true", firstDay : 1, } document.addEventListener(‘DOMContentLoaded’, function() ..

Read more

I was using tingle.js and pikday and now I want to use materialize css because it got both modal and day picker. In tingle I add buttons and the action after button click easily //add a button modal.addFooterBtn(‘Button label’, ‘tingle-btn tingle-btn–primary’, function() { // here goes some logic modal.close(); }); // add another button modal.addFooterBtn(‘Dangerous ..

Read more

I’m using the Materialize-CSS file input. I’m trying to implement a button which removes the value from the file-input and the validation (to clear it). If I click on the ‘X’ button nothing happens, but I don’t know why. I’m thankful for any help 🙂 function clearFileInput() { document.getElementById(“imgInp”).value = “”; } <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> <div ..

Read more