Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:20:21+00:00 2026-05-26T12:20:21+00:00

I have the following: <ol id=listItems> <li id=listItem-1> <span class=title>Item 1</span> <span class=delete>delete</span> </li>

  • 0

I have the following:

<ol id="listItems>
    <li id="listItem-1">
        <span class="title">Item 1</span>
        <span class="delete">delete</span>
    </li>
    <li id="listItem-2">
        <span class="title">Item 2</span>
        <span class="delete">delete</span>
    </li>
    <li id="listItem-3">
        <span class="title">Item 3</span>
        <span class="delete">delete</span>
    </li>
    <li id="listItem-4">
        <span class="title">Item 4</span>
        <span class="delete">delete</span>
    </li>
</ol>

What I want to do here is anytime .delete is clicked, I want to show a jQuery ui-dialog for confirmation, Yes or No…. If the user says yes then continue with the delete click where it will be deleted as is today.

How can I build a jQuery UI Dialog that is static and would work for any number of list items? Better yet would work for anything in my app so it’s not just list specific.

Ideas? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:20:21+00:00Added an answer on May 26, 2026 at 12:20 pm

    Example using JQuery UI dialog –

    Demo – http://jsfiddle.net/CdwB9/3/

    function yesnodialog(button1, button2, element){
      var btns = {};
      btns[button1] = function(){ 
          element.parents('li').hide();
          $(this).dialog("close");
      };
      btns[button2] = function(){ 
          // Do nothing
          $(this).dialog("close");
      };
      $("<div></div>").dialog({
        autoOpen: true,
        title: 'Condition',
        modal:true,
        buttons:btns
      });
    }
    $('.delete').click(function(){
        yesnodialog('Yes', 'No', $(this));
    })
    

    With live –

    Demo – http://jsfiddle.net/CdwB9/4/

    $('.delete').live('click', function(){
        yesnodialog('Yes', 'No', $(this));
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following markup <ol> <li class=ListItem> <span class=sub>@qItem.CategoryText</span> <input type=image src=http://icons.iconarchive.com/icons/tatice/just-bins/256/bin-red-full-icon.png width=30
I have the following code: foreach (ListItem item in check.Items) { if (item.Selected) {
I have the following statement: var itemsFromList = from item in ListItems where item.Countries
I've to following question. I've a multiple listitem and i want show the three
I have the following item name in my xml to be transformed <title>abc \
I have a following code: foreach (ListItem item in lstCreate.Items) { if (item.Selected) strCreateNewVideoCategory
I have the following very simple form: <asp:UpdatePanel ID=ClaimRewardsForm runat=server> <ContentTemplate> <span class=largeBold>Select jacket
I have the following test ASPX page: <head runat=server> <title></title> <script src=js/jquery-1.2.6.min.js type=text/javascript></script> <script
If I have the following code : <li> <span class=radio_appt> <input id=color1 type=radio name=ctl00$cph1$appointment
Let's say we have the following html: <ul id=portfolio-list class=clearfix span-24> <li class=2012#foo bar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.