Topic: Adding field dynamically
When adding fields dynamically using javascript, the border of the field is now shown. for example tried adding
<div class="form-group row" id="addcf1row">
<div class="form-outline mb-4" id="addcf1div">
<input type="text" class="form-control shadow-none" id="addcf1" name="addcf1" value="" maxlength="50">
<label for="addcf1" class="form-label" id="addcf1">text</label>
</div>
</div>
kpienkowska staff answered 2 years ago
That's because you have to init input fields if they are not present when HTML is initially loaded.
Example in docs: https://mdbootstrap.com/docs/standard/forms/input-fields/#section-dynamic-input-initialization
dagaey commented 2 years ago
This does not work for select/date fields. Can you provide an example of how to initialize select and datepicker fields?
kpienkowska staff commented 2 years ago
I've prepared a code example for you: https://mdbootstrap.com/snippets/standard/kpienkowska/5196028
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: desktop
- Browser: chrome
- OS: windows
- Provided sample code: No
- Provided link: No