php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27319 can't use checkboxes sharing same control name
Submitted: 2004-02-19 04:15 UTC Modified: 2004-02-19 04:25 UTC
From: cigorin at pobox dot sk Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.4 OS: Debian GNU/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cigorin at pobox dot sk
New email:
PHP Version: OS:

 

 [2004-02-19 04:15 UTC] cigorin at pobox dot sk
Description:
------------
When there are more checkboxes within form, which share same control name, it is impossible to get all checked values after form is submitted. The problem holds over regardless what method is used. Normally I'd expect array of values in $_REQUEST superglobal variable instead of single basic value. To be honest I've found the problem in PHP Version 4.3.3 and didn't check if it exists in later versions.

Reproduce code:
---------------
<?php //this is file example.php
  print_r($_REQUEST['records']);
?>

<form method="get" action="example.php">
  <input type="checkbox" name="records" value="A" checked>
  <input type="checkbox" name="records" value="B" checked>
  <input type="submit">
</form>


Expected result:
----------------
Array ( [1] => A [2] => B)

Actual result:
--------------
B

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-19 04:25 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 16:01:31 2024 UTC