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 8204303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:51:25+00:00 2026-06-07T07:51:25+00:00

My question is more geared towards approach than it is programming or errors. I

  • 0

My question is more geared towards approach than it is programming or errors.

I have a query that runs and gathers a set of data. I then want to use that query’s return values to build a table on a page listing all the values. Along with that I need to have some actions with each value for example:

my_val (edit) (delete)
my_cal (edit) (delete)

Where edit and delete are buttons. So the edit button I have working with onClick javascript, where i’m redirected to another page, but the delete button i need that to do three things:

  1. prompt user, okay to delete? msg (using javascript for that (return confirmation…).
  2. execute query to delete
  3. refresh page (self)

Is there a best approach model for this? Is it easier to call two inline javascript commands? Use javascript functions? Maybe a ColdFusion function?

any pointers would be helpful! 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-06-07T07:51:26+00:00Added an answer on June 7, 2026 at 7:51 am

    I think the easiest way for the delete is something like this. I do assume you use jQuery or some other library or get the JavaScript stuff.

    YourPage.cfm
    <cfif structKeyExists(URL, "Action") and URL.Action eq "delete">
        <cfququery>
           // delete the item using the id provided
        </cfquery>
    </cfif>
    
    <cfquery name="GetFresh">
        // get fresh info
    </cfquery>
    
    <cfloop query="GetFresh">
        Something <span class='DeleteLink' data-someid='#SomeID#'>delete</span> <br>
    </cfloop>
    
    <script type='text/javascript'>
    
        $DeleteLinks = $("span.DeleteLink");
    
        $DeleteLink.click(function() {
            var Confirm = confirm('Are you sure you want to delete?');
            if (Confirm == true) {
               var SomeID = $(this).data("someid");
               var URL = "YourPage.cfm?Action=delete&SomeID=" + SomeID;
               window.location = URL;
            }
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is more UI/Design-ish than hard-core programming is. Background: I've been coding in
This may be a math question more than a programming question, but we'll see.
I've a question more about 'Good Programming Practices'. I have just started a really
This is related to my previous question More than 1 Left joins in MSAccess
This is a code review question more then anything. I have the following problem:
ASP.Net MVC3 is cool and all but I have this question more out of
This question is more about guidance than actually solving my problem: I need to
This question is more a re-insurance than one directly about how to code. As
Edit: Maybe I made the question more complex than it should. My questions is
I don't know is this question more related to mathematics or programming and I'm

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.