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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:37:22+00:00 2026-06-16T15:37:22+00:00

Apologies what what is probably a poor title for this question – I struggled

  • 0

Apologies what what is probably a poor title for this question – I struggled to come up with anything better!

I’m working on a simple ‘to do’ list as part of a wider application, and have hit a stumbling block with my limited jQuery/Javascript knowledge.

The page features a number of checkboxes – one alongside each ‘task’. What I need to do is fire off a ‘get’ event each time a checkbox is checked or unchecked (the ‘get’ will fire a backend script that saves the status – i.e checked will save it as ‘done’, whereas unchecking it will save it as ‘pending’).

I’ve got so far as to fire back an alert when the user interacts with the checkboxes, and have now got the alert to display the value (which is a simple ID of the task) of the checkbox, but I’m stuck on how I get all of this together to trigger the .get

Here’s what I have so far…

<script>
$(document).ready(function(){
$(":checkbox").change(function(){
    if($(this).attr("checked"))
    {
        alert($(this).is(':checked'))
    }
    else
    {
        alert($(this).val());
    }
});
});
</script>

<input type="checkbox" value="#itemID#">

Pointers much appreciated!

  • 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-16T15:37:23+00:00Added an answer on June 16, 2026 at 3:37 pm

    Can do an AJAX request as follows:

    $(":checkbox").change(function(){
         var data= { 
             id: this.value,
             status : this.checked ? 'done' :'pending'
         } ;
        $.get( 'serverFile.php', data, function(response){
             /* ajax is complete here, can do something with response if needed*/
         })
    
    });
    

    At server you would receive the data as you would a form with field names id and status

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

Sidebar

Related Questions

Apologies for probably simple question, I've read the docs and still can't get this
This is probably a very simple question, I apologise - I'm new to rails.
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs
Apologies if the title does not accurately describe the question (which it probably doesn't).
Apologies if this question is too open ended, and would be better asked somewhere
I will start by saying this is probably a dumb question so apologies if
This is probably a really easy question, so apologies for not being more challenging!
No idea how to go about this. Apologies if it's a stupid question (probably
Apologies for asking what's probably a very obvious question, I've been banging my head
This question is probably borderline for stack overflow, so I apologize in advance if

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.