Closed irfabid closed 5 years ago
I actually modified the source to workaround this. For anyone else wondering:
Change following line:
var hiddenInput = dropdown.querySelector('input[type="hidden"]');
to these two:
var lab=dropdown.querySelector('label');
var hiddenInput=document.querySelector('input[name='+lab.htmlFor+']');
Now you just have to set "for" attribute on label to same value as "name" attribute value of target hidden input.
Hi @irfabid,
So hidden input is inside the form but this select element is outside.
getmdl-select library does not provide such the case. All HTML elements for coresponding select should place in div
wrap with class getmdl-select
.
But perhaps your experience will be useful for someone.
Thanks
I have a requirement where this select element is outside the form but I still need to send value by POST on form submission (Not using any Javascript or framework). So hidden input is inside the form but this select element is outside. It should work by assigning value to hidden element by Id or Name regardless where that element appears.