Topic: Unable to properly clone form with select
mmmarkk01 priority asked 10 months ago
When using cloneNode() to duplicate a form I would expect the
<select> to keep its options.
<select> functionality breaks and no options can be selected.
Press the 'Add formset' button in the snippet to see the bug:
It won't work because you are copying Select elements which where generated via our script. They will still have the same ids. And you will not get options wrapper which is being render outside your form. Which is why you don't have options to choose from. You did not copy this part, which again will have the same ids.
You need to make new select for each form. If you want the same options, just create options object and pass it to these selects via JS.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.10.1
- Device: PC
- Browser: Edge
- OS: Windows
- Provided sample code: Yes
- Provided link: Yes