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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:13:18+00:00 2026-05-20T18:13:18+00:00

I seem to be running into something really nasty: I have a form which

  • 0

I seem to be running into something really nasty:

I have a form which contains a group of checkboxes.
I have set up validation rules for my form, and just added an empty one
for my checkbox group. However, after validating my form and giving an error,
it only rechecks the last one in the group that was selected. This is just
driving me nuts, since the user will never notice it was unchecked!

for now, before building up the system, I just hardcoded the form to check if it works
how I want it to work.

<fieldset>
    <legend>Locaties veldwedstrijden</legend>
    <?php echo form_checkbox('locatie','oudenaarde', set_checkbox('locatie','oudenaarde'));?>3-7-2011 te Oudenaarde <br />
    <?php echo form_checkbox('locatie','arendonk', set_checkbox('locatie','arendonk'));?>31-7-2011 Arendonk<br />
    <?php echo form_checkbox('locatie','westdonk', set_checkbox('locatie','westdonk'));?>11-09-2011 Westhoek – MERKEN<br />
</fieldset> 

It also has this validation rule in it:

array('field' => 'locatie','label' => '','rules' => ''),

Can anybody tell me what I’m doing wrong? I read the whole manual, but I can’t
find the slightest hint of what might be wrong with this code…

  • 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-20T18:13:18+00:00Added an answer on May 20, 2026 at 6:13 pm

    You’re using a checkbox like a radio button. No matter how many checked checkbox, they’re all named locatie, php will only see one value.

    If you wanted to save multiple values from the checkbox, you’d either need to use a different name for each checkbox (locatie1, locatie2, locatie3) or use a php style name array (locatie[]). I’m not sure for the latter that the CI form helper function will work properly with that style of naming though.

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

Sidebar

Related Questions

While writing an iPad application, I seem to be running into a lot of
I seem to have the luck to run into the funniest problems while deploying
I can't seem to get my application up and running on my dev server
ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the
Excel macros do not seem to allow the use of undo after running them.
When running on an xhtml page, xpath doesn't seem to return any results. var
I'm running PHP on Windows/IIS. My session variables don't seem to be preserved from
I seem to be missing something about LINQ. To me, it looks like it's
I seem to remember reading something about how it is bad for structs to
I keep running into this issue: class CCreateShortcutTask : public CTask { public: CCreateShortcutTask(

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.