Topic: Onclick does no longer work can I use Popconfirm and how

pbeks priority asked 2 months ago


I used to use the following code to ask for confirmation before deleting an item:

<?php if (MD_CanDelModule()) { ?><a href="index.php?MD_Action=DelModule&MD_ModuleId=<?php echo $MD_ModuleId ?>" onClick="return ConfirmLink('Are you sure?');"><i class="far fa-trash-alt" aria-hidden="true"></i></a>

This does no longer seem to work with MDBootstrap 5 so I chaned it to:

<a href="index.php?MD_Action=DelModule&MD_ModuleId=<?php echo $MD_ModuleId ?>" class="popconfirm-toggle" data-mdb-popconfirm-mode="modal" data-mdb-message='Are you sure?'></class><i class="far fa-trash-alt pe-auto" aria-hidden="true"></i></a>

No I do have a popup asking a question, however no mater what I select the URL is still loaded, how can I make it wait until I made a selection and only load the url when I press OK?

You can find the sample here: Snipped


mlazaru staff answered 2 months ago


Hi,

You could add eventListener on 'confirm.mdb.popconfirm'. Check my snippet: https://mdbootstrap.com/snippets/standard/mlazaru/4658362#html-tab-view



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.0.1
  • Device: PC
  • Browser: Chrome
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes