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

  • Home
  • SEARCH
  • 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 8572289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:58:32+00:00 2026-06-11T18:58:32+00:00

I am using CodeIgniter to display a list of items from the database. I

  • 0

I am using CodeIgniter to display a list of items from the database. I want to delete an item based on it’s ID. This is not a problem and works fine without the modal box.

My issue is that I am using a jQuery plugin called reveal (http://goo.gl/3lzRN) to add a modal box to confirm deletion. This works for the first item in the list, but the others have the same ID as the first.

<a href="pages/<?php echo $row->id; ?>" class="delete">
    <i class="icon-cancel"></i><span class="delete_tooltip">delete page</span>
</a>

<aside id="modal">
    <header id="delete_page">Delete Page</header>
    <article id="modal_content">
        <p>
        Are you sure you want to delete the page<br />'<?php echo $row->title ?>'?
        </p>

        <p>This action cannot be undone.</p>

        <p>
        <a href="pages/delete_page/<?php echo $row->id; ?>" >
            <i class="icon-cancel"></i>Delete
        </a> <a href="pages/#" class="modal_cancel">Cancel</a> 
        </p>
    </article>
</aside>

Above is the link to open the modal box, and the content in it. These are within a foreach loop, but as I know the loop works fine, I haven’t posted it.

  • 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-06-11T18:58:34+00:00Added an answer on June 11, 2026 at 6:58 pm

    You should use a class instead of an ID. IDs should only be present once per page, and thus this is what is causing your problem.

    Classes are used for items that appear more than once (reusable items).

    I’d recommend also assigning a unique id to the modals too, something like id=”modal-1″ where 1 is the ID from $row->id;

    This way, each of your modals can be accessed through the class easily, but can be uniquely identified by their ID.

    http://jsfiddle.net/Z7vHT/1/ That should fix your issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using CodeIgniter and I want to display a list of cities in multiple
This is weird... I'm using the MVC pattern in php (codeigniter) to display a
I am using CodeIgniter 2.1.0 and MySQL. I want to display a horizontal data
In my codeigniter application i want to display the uri segments.Iam using ajax to
I'm using CodeIgniter + Zend libraries. I want to let users upload videos to
I'm using codeigniter framework and I'm getting this error when I've submitted my form:
I'm using the following CodeIgniter function to upload files which works fine: function uploadFiles(){
Using CodeIgniter, how do I access and display text entered into an input field
I am using codeigniter and what i want to do is when user logs
I'm trying to access an FTP server from my PHP script using Codeigniter's FTP

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.