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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:22:22+00:00 2026-05-14T15:22:22+00:00

I have an an ajax request that looks like this, $(‘input.fakecheck’).click(function(){ alert(deleteing….); $.ajax({ url:/search,

  • 0

I have an an ajax request that looks like this,

$('input.fakecheck').click(function(){
alert("deleteing....");
$.ajax({
    url:"/search",
    type:"POST",
    data: $(this).attr('name')+"="+$(this).attr('value')+"&remove=Remove",
    success:function() {
        alert(data);
    }
})

})

This calls a php function which looks like this,

private function _remove_from_short_list($cv_array)
    {
        if (is_array($cv_array))
        {
            $short_list = $this->session->userdata('short_list');
            $new_list = array_diff_key($short_list, $cv_array);
            $this->session->set_userdata('short_list', $new_list);

        }
    }

Essentiallty what happens is that on my page I have a list which is essentially a list of id’s taken out of the session, the user can then by click and input(this will change) delete the id from their session. However once the deletion has taken place I want to be able to refresh the list to show that it has taken place, currently nothing happens, until I manually refresh.

  • 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-14T15:22:23+00:00Added an answer on May 14, 2026 at 3:22 pm

    You will usually want to fire something in the success function to modify the list.

    Say if you had a structure like this

    <ul>
        <li>
            <input id="1" type="checkbox" class="fakecheck" />
        </li>
        <li>
            <input id="2" type="checkbox" class="fakecheck" />
        </li>
    </ul>
    

    In the success function, you could remove the li after you’ve done the deletion

    $(this).parent().remove()
    

    This obviously doesn’t take into account any error handling in the AJAX request. If you could post the HTML for your list I could also get a better feel for the structure you’re trying to change.

    As Pointy mentions, you will have to be sure that you’ve server request has actually deleted the item if you’re going to modify the list in place, instead of fetching an updated list.

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

Sidebar

Related Questions

I have an ajax request that looks like this, $(#frmProducts).submit(function(){ var dataSet = $(#frmProducts).serialize();
I have a link that looks like this: <a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true});
I am making an ajax request using JQuery that looks like this: var data
Here's an interesting problem: I have some jQuery that looks like this: $(document).ready(function() {
I have HTML that looks like this: <form id=kinodForm> <input type=text name=element[5] value=krispy kreme
I have some jQuery that looks like this: $.ajax({ type: POST, url: /Customer/CancelSubscription/<%= Model.Customer.Id
I have a layout that looks like this: It's a table with one cell
I have a form that looks something like this <form action=# class=ajax_form method=post id=comment_form
I have an action that looks like this: [Post] [PopulateModelFromId] public ActionResult ChangeName( string
I have an Ajax request from a page in my Rails app that looks

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.