Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: Confirming the Deletion of an item  (Read 342 times)


  • Jr. Member
  • **
  • Posts: 76
  • Karma: +0/-0
Confirming the Deletion of an item
« on: 1 Jul 2021, 05:11:48 pm »
What is the best way to handle confirming the user clicking on an option to remove something?

I'm inclined to use a modal dialog to ask them to confirm the removal including passing the item's id and a description, however that would require javascript to pass the id and description, as well as javascript to handle the call to remove the item.

I could take them to another page and ask them to confirm on that page?  It would work but doesn't seem like a great UI.



Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 919
  • Karma: +171/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: Confirming the Deletion of an item
« Reply #1 on: 3 Jul 2021, 10:17:43 am »
You don't actually need JavaScript for modals, but it would hinge on how many items you have on a page that can be deleted.

Traditionally I like to write it so that it works without JavaScript via page-loads first for accessibility and to hammer out / test the logic, then ENHANCE the page with JavaScript that calls the exact same database handling routines but with a cleaner client side rendered interface using JSON or XML to avoid the page-loads if the client really desires it.

But remember, pageloads are NOT inherently evil or bad, and should NOT be any different than the scripted approaches apart from leaving a page you might not want to leave.

Rule #1, quality JavaScript should enhance an already working page, not supplant what can be done without it. If you can't make a fully working page without scripting first, it's very likely you have no business adding scripting to it.
I'll fix every flaw, I'll break every law, I'll tear up the rulebook if that's what it takes. You will see, I will crush this cold machine.


SMF spam blocked by CleanTalk