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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:55:40+00:00 2026-06-14T09:55:40+00:00

I am currently working on a javascript and php project. I have a checkbox

  • 0

I am currently working on a javascript and php project. I have a checkbox array that have the same id chkCategory and the name chkCategory[]. I then have PHP return some json that contains the various categories and I want to set each checkbox checked attribute for each category that was in the json. The only thing that identifies each checkbox is the value. I.e. the json may have a value MyCategory so the checkbox that has the value MyCategory should be set.

I know you can use $("#myCheckBoxId").attr("checked", true) for an individual checkbox but not sure how to do this for a specific checkbox with a certain value.

Thanks for any help you can provide.

  • 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-14T09:55:42+00:00Added an answer on June 14, 2026 at 9:55 am

    You can use standard CSS attribute selectors in JQuery. For example:

    $("input[value=MyCategory]")
    

    will select the input tag with attribute value=MyCategory. If there are different types of inputs with that value, you could also select on type=checkbox:

    $("input[type=checkbox][value=MyCategory]")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a php/html/javascript project. I have a form where when
I'm currently working on a JavaScript project that uses the HTML5 canvas as a
I am currently working on a php/javascript project which retrieves information from a database
I am currently working on a fun project, which involves Ajax, HTML, JavaScript, PHP
I am currently working on a php/html/javascript project and am doing ajax post to
So I'm a coder, I do PHP, JavaScript, and Objective-C. I'm currently working on
I am currently working on a project that will involve credit card swipes for
I am currently working on a php e-mail system. I created a javascript pop-up
Currently i have a working PHP edit script, which allows users to edit ads
I'm currently working on a php mysql base system that will send email to

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.