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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:59:48+00:00 2026-06-08T06:59:48+00:00

I know the question title may be confusing, but here is what I am

  • 0

I know the question title may be confusing, but here is what I am trying to achieve:

I have a UL within a table filled with many items. One of the cells of the list contains a checkbox. Those checkboxes are all named in an array “itemsDone[]” I have a button in a side menu (outside of a form). I would like this button to send a query to my server to update a value for each checkbox that is checked… is it possible? I’ve been Googling for roughly an hour, and I may be seeking the wrong keywords… I would appreciate any help given.

Thank you guys and have a nice day!

Edit: There are no forms at all inside the PHP page.

Edit2: Here is the code I now have:

<script type="text/javascript">
$(document).ready(function(){

    $("#saveCheckboxes").click(function(){
        var check = Array();
        var counter= 0;

        $('.itemsDone').each(function(){
            if(this.checked)
            {
                check[counter] = this.value;
                counter+=1;
                console.log(check[counter]);
            }
        })

        $.post('setCommandes.php',{'check[]':check}, function(data) {

            alert(data);

        });      
       return false;
    });
});
</script>

Here is my setCommandes.php content:

<?php
    include('includes/connexion.php');
    $data = $_POST['check[]'];

    $db_select=mssql_select_db("Test_CommandesWeb");
    foreach ($data as $checks)
    {
        $sql = "UPDATE Commandes SET CommandeFaite='1' WHERE CommandeId='$checks'";
        mssql_query($sql,$connexion);
    }
?>

I am getting an error (Invalid argument supplied) on my foreach statement at the moment.

  • 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-08T06:59:50+00:00Added an answer on June 8, 2026 at 6:59 am

    You should be able to do this using jQuery.post()

    I’m not sure about what your page looks like but I guess the code would be something like this:


    //make sure to use the a proper selector

    //so, do the following when .class is clicked
    $(".class").click(function(){
    
        //select the value 
        $('select.foo').val();
    
        //post the data
        $.post('ajax/test.html', function(data) {
    
            //replace the .result div with the
            //response from the server
            $('.result').html(data);
    
        });      
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i didn't really know how to title this question, but here's a thing that
The question's title may sound stupid, but I have beenw wondering about the following
I'm here again with another question/problem. I know that topic's title may be like
Okay the question title may not have made sense... mostly because I don't know
I know the title of the question sounds absolutely weird but I had no
I don't know which title I should use for this question. I have a
I know this may seem like a silly question and I have attempted to
I appreciate that this may appear to many as a dum question but I
I know this may be a silly question but for this application I cannot
I know I have asked this question in a different manner earlier today but

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.