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

  • Home
  • SEARCH
  • 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 8357959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:39:11+00:00 2026-06-09T10:39:11+00:00

I am having bit of issue getting text value of database populated check boxes.Below

  • 0

I am having bit of issue getting text value of database populated check boxes.Below is my query that populate check box depending on my query.

if (isset($_POST['submitCourseCode'])) { 

    $aElective = $_POST['electiveModules'];
     foreach(array_keys($aElective) as $elec) {
     echo "$elec";
  }
}
echo "<form name=\"psform\" action=\"plotyourcourseGraphpSave.php\" method=\"post\">";
$moduleQuery = "SELECT module.*,group_elective_modules.moduleID 
                FROM module,group_elective_modules 
                WHERE group_elective_modules.courseName = '$courseTitle' 
                AND group_elective_modules.yr = '$year' 
                AND group_elective_modules.moduleID = module.ID ";

$moduleResult = mysql_query($moduleQuery );
while ($row = mysql_fetch_array($moduleResult)) {

   echo "<input type=\"checkbox\" name=\"electiveModules[]\" value=\"{$row['title']}\" /> {$row['title']}<br />";                                                       
}                                                                                                                                   
echo "<input type=\"submit\" name=\"submitCourseCode\" value=\"Submit\" />  
</form>";

Here are the screen shots
enter image description here

Result of selected check boxes

enter image description here

But this is what I want

Threshold French
French for Reading Purposes I
German Language (Beginner [00] Level)
German Language (Intermediate [05] Level)

So when I select few of the check boxes and I press submit,it passes on numeric value of check boxes I picked but I want the text value instead. Any help on this please ?

  • 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-09T10:39:13+00:00Added an answer on June 9, 2026 at 10:39 am

    this is the incorrect code:

    foreach(array_keys($aElective) as $elec)
    

    because you use array_keys, it will get the index instead of the value,
    it should be:

    foreach($aElective as $elec)

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

Sidebar

Related Questions

I'm having a bit of an issue with a query and scaling that query
I'm having a bit of an issue getting some stylesheet behavior that I want.
I'm having a bit of an issue uploading files to a database. I'll post
I am having a bit of an issue with getting tumblr working within a
I'm having an issue with LINQ2Sql where the value in the database is not
So I'm having a bit of an issue getting my properties to set properly
I am having a bit of an issue getting the file path from the
I'm having a bit of an... odd issue. I'm getting an error with saving
I'm having a bit of an issue. I am getting some values from my
I'm having a bit of an issue when dealing with getting a timestamp from

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.