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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:52:33+00:00 2026-05-14T21:52:33+00:00

I am working on a jQuery-based todo list interface, and have hit a bit

  • 0

I am working on a jQuery-based todo list interface, and have hit a bit of a wall. The jQuery I am working with is a bit hacked together from various tutorials I have read, as I’m a bit of a beginner.

$('#todo input:checkbox').click(function(){
  var id = this.attr("value");
  if(!$(this).is(":checked")) {
    alert("Starting.");
    $.ajax({
      type: "GET",
      url: "/todos/check/"+id,
      success: function(){
        alert("It worked.")
      }
    });
  }
})

This is the HTML I am using,

<div id="todo"> 
  <input type="checkbox" checked="yes" value="1"> Hello, world. <br />
</div>

Any help on this would be greatly appreciated. For reference, thereason I have alerts in the jQuery is for debugging. The reason I can tell the code isn’t working is because I am not getting these alerts. 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-14T21:52:34+00:00Added an answer on May 14, 2026 at 9:52 pm

    Just a quick glance and I think the if(!$(this).is(":checked")) portion may be the issue. Try something more like if( !$(this).attr('checked') )

    Also: the url in your ajax statement doesn’t look right. It appears to be an absolute path instead of a relative one to me.

    One more thing: Shouldn’t var id = this.attr("value"); be var id = $(this).attr("value"); ?

    Let me know if these tips help. Otherwise a general tip:

    In your code you appear to be testing three things simultaneously. First it has to attach the event to the correct checkbox. Then it has to pass a condition, and then it has to make a successful ajax call. We only get feedback if all three things worked, otherwise if one is out of place, then we have no way of knowing where the failure was. Test each piece to make sure it works, and then you’ll know where to focus your efforts. 🙂

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

Sidebar

Related Questions

I'm working on javascript/jquery in a php based site, and I have to redirect
I have built a sortable list using jQuery UI's sortable feature, this is working
I'm working on my first very complex JQuery based application. A single web page
I am working with a touch based slideshow for the iPad using Jquery tools
I'm working with jquery. And i have text input in a form, i would
I'm working with Jquery in Drupal. I have sets of four blocks that all
How do I remove all the values from a dropdown list using jQuery? idnum
I have written this simple bit of jQuery that swaps out the containing ul's
I am working on a site that has some jquery based animation, and I
I have a an application built with the jQuery based fullCalendar http://arshaw.com/fullcalendar/ My calendars

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.