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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:11:35+00:00 2026-06-10T13:11:35+00:00

Alright, I’m making a website using PHP/HTML, and I have some backend AJAX to

  • 0

Alright, I’m making a website using PHP/HTML, and I have some backend AJAX to auto generate some checkboxes with data based on a drop down menu selection earlier in the page.

Basically here is the process…

->Select a Job Name (JobXYZ) from a drop down menu
->Checkboxes are automatically generated (pulled from a databse), anywhere from 0-10+ can be created, they are of car names associated with the selected job.

Here is the little code snippet that generates these checkboxes…

$sql = "SELECT Description FROM Cars WHERE JobNumber='$JobNumber'";

$rs = odbc_exec($connection, $sql);

while(odbc_fetch_row($rs)) {
    $rowCarDeets = odbc_result($rs, 'Description');
    $response = $response . "<input type='checkbox' name='CarDescription' value='" . $rowCarDeets . "'>". $rowCarDeets . "</input></br>";
}

As you can see, the checkboxes are all called ‘CarDescription’ and then the value is filled in. When the website is actually created and these checkboxes are created, I can confirm via inspecting these elements on the webpage that they do have the name ‘CarDescription’ with varying values that are the correct values. What I’m saying is that the auto creation of these checkboxes works as intended.

They are all a part of a form that is submitted along with several other things that get submitted via a ‘post’ at the click of a submit button.

From there I go to my form submit php file and I simply grab everything that has been posted like so…

$Variable=$_POST[‘VariableName’];

I try to do it with car description as I do everything else…

$CarDescription=$_POST[‘CarDescription’]; but it doesn’t work. There are two issues here…

  1. Even if I select just one checkbox and submit it, nothing goes through. Based on my work with other checkboxes, checkboxes with the same name but different values should still get posted if only one is selected. That isn’t the case here.

  2. I will need to be able to select multiple checkboxes in the future, how can I deal with this? Is there a way to post something as an array of checkbox values or something of that nature? Before I deal with this problem though I figure I should fix the issue I am having with just properly sending any data at all (from a single checkbox).

Your help would be greatly appreciated!

EDIT: This information doesn’t even seem to be getting posted. Even if I make it into an array I get the following warning:

Notice: Undefined index: CarDescription in C:\---submit_form.php on line 26 

This here is line 26….

    $CarDescription=$_POST['CarDescription'];

Again, this happens if I make it an array, make tons of changes to it, etc.

  • 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-10T13:11:37+00:00Added an answer on June 10, 2026 at 1:11 pm

    On this line:

    $response = $response . "<input type='checkbox' name='CarDescription' value='" . $rowCarDeets . "'>". $rowCarDeets . "</input></br>";
    

    Change the name field to name=CarDescription[]. They are then accessible in PHP as an array. Run this to see what it contains: print_r($_POST["CarDescription"])

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

Sidebar

Related Questions

Alright, I have some questions... When you have a moment, can you take a
Alright, So I have an issue that is a bit weird. I am using
Alright, so I have 2 buttons inline in my header with an HTML structure
Alright. I have several queries <?php // Make a MySQL Connection mysql_connect(mm.hostname.net, user, pass)
Alright, currently I have my SWF hitting a php file that will go and
Alright. So I have a very large amount of binary data (let's say, 10GB)
Alright so I have no idea how to even begin doing this But basically
Alright I created some custom classes for my project sourced from this tutorial ,
Alright so I have been looking around (on SO and Google) to see if
Alright, i have read many different views on how to do this with no

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.