Topic: Modal two modal open when i create button dynamicaly after loading page
hebeldark@outlook.fr asked 4 years ago
hi,
in my php page, i use 2 buttons on the top with modal and one button inside jsgrid with modal
with bootstrap4/Jquery, it's working
with MDB5 the button poolINSERT and poolINSERTaide are functionnals
<button id="poolINSERT" class="btn-sm btn btnSquare bg_color_indigo-200 ml-2 mr-2" data-mdb-toggle="modal" data-mdb-target="#insertpool">
<i class="far fa-file-alt fa-lg mr-2"></i>Ajouter / Modifier un groupe</button>
<button id="poolDELETE" onClick="onClickDELETETPOOL()" class="btn-sm btn btnSquare btn-danger text-white ml-2 mr-2" data-toggle="tooltip" data-trigger="hover" data-placement="top" title="Suppression d'un groupe">
<i class="fas fa-trash-alt fa-lg"></i></button>
<button id="poolINSERTaide" class="btn btn-sm btnSquare bg_color_indigo-100" data-mdb-toggle="modal" data-mdb-target="#insertpoolaide">
<i class="far fa-file-alt fa-lg mr-2"></i>Aide</button>
if i use jscript to add a button var customDIV = $("").append('Réservé par'); title="Suppression d'un groupe" var customBTN = $("").attr("type", "button").text("") .attr("data-mdb-toggle", "modal").attr("data-mdb-target", "#insertaddreservepar") .addClass("btn btn-sm btnSquare bg_color_indigo-500 text-white ml-2")
customBTN.append("<i class='far fa-plus-square/i>");
customDIV.append(customBTN);
when i click on button btnAddReservePar, two modal opened: #insertpoolaide and #insertaddreservepar
and on console, i have this error
sorry i can't to use snippet; my company network doesn't allow this page
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Open
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: 3.0.0
- Device: PC
- Browser: Opera
- OS: Win10 x64
- Provided sample code: No
- Provided link: No
Grzegorz Bujański staff commented 4 years ago
The code sent is not working properly.
customDiv
is not added anywhere on the page. Similar to the dropdown issue - it needs a working example with this bug to debug it