Php checkbox checkbox on the way to deal with

2010-06-10  来源:本站原创  分类:PHP  人气:141 

php required elements in the array form of the same name as form name, and give value. Otherwise he indecomposable.
Example:

<input type=checkbox name="chk[]" value=1>
<input type=checkbox name="chk[]" value=2>
<input type=checkbox name="chk[]" value=3>

Submitted, with $ _POST ['chk'] access. Elements of an array of values for the selected check box

PHP Code:

<?php
foreach( $_POST["chk"] as $i=>$a )
  { echo $i."==>".$a."<br />"; }
// Or use the  $_POST["chk"][0] Separate use
?>

Results:
0 => 1
1 => 2
2 => 3

相关文章
  • JSP in the value of the checkbox checkbox 2010-04-02

    JSP in the value of the checkbox checkbox JSP 2009-08-09 22:58:04 read 500 comments 0 font size: small medium and large Use the checkboxes to select one can easily select multiple data, the user is very convenient. A method is given below, learning t

  • Php checkbox checkbox on the way to deal with 2010-06-10

    php required elements in the array form of the same name as form name, and give value. Otherwise he indecomposable. Example: <input type=checkbox name="chk[]" value=1> <input type=checkbox name="chk[]" value=2> <input ty

  • ZK client programming of Checkbox checkbox (Select All / Clear All) 2010-07-01

    on June 30, 2010, I have met a question In ZK client programming, use of convenience between ZK is based annotation "@{}", but all things are double-edged sword, when we use annotations to achieve AfterCompse interface, automatic zk help us to b

  • Combination of the background value from the dynamic selection checkbox checkbox ID 2010-09-11

    / / First change has been selected checkbox is not selected into function clearCheckbox () ( $ ("Input [name = user.menus]"). Each ( function () ( if ($ (this). attr ("checked", true)) ( $ (This). Attr ("checked", false); ) )

  • Checkbox to use with RadioGroup 2010-08-08

    To use Checkbox with RadioGroup Yes! Is not the Checkbox Checkbox and RadioGroup and Radio. Ex provides Checkbox and Radio, in the control group the same name, such as the gender of men and women both use sex as a Radio control name, findField method

  • Common js Select All checkbox button function 2009-03-24

    Transfer from: http://stephen830.javaeye.com/blog/261154 Keyword: js Select All checkbox button WEB projects at about the Select All checkbox function will certainly be encountered, and each project will have a lot of places will be used. The followi

  • Jquery access form text, areatext, radio, checkbox, select the value of the code 2010-03-20

    jquery radio value, checkbox values, select values, radio check, checkbox is selected, select selected, and its associated radio access to a group of selected items of value var item = $ ('input [@ name = items] [@ checked]'). val (); Access to selec

  • Get inside the CheckBox DataGrid 2010-02-28

    DataGrid in WinForm to obtain the CheckBox: checkbox of the names are different: for(int i=0;i<MyDataGrid.Items.Count;i++) { CheckBox ck=(CheckBox)MyDataGrid.Items[i].FindControl("ck_delete"); if(ck.Checkde) { ... } } checkbox the same name:

  • JQUERY access to text, areatext, radio, checkbox, select the value 2010-04-08

    jquery radio value, checkbox values, select values, radio check, checkbox is selected, select selected, and its associated radio access to a group of selected items of value var item = $ ('input [@ name = items] [@ checked]'). val (); Access to selec

  • JQuery operation checkbox.radio 2010-04-14

    JQuery operation checkbox, radio Radio is selected for a group of key values var type = $ ('input [@ name = type] [@ checked]'). val (); var usable = $ ('input [@ name = usable] [@ checked]'). val () Access to select the text of the selected items va

  • checkbox multiple selection 2010-04-19

    <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN"> <html> <head> <title> New Document </ title> <meta name="Generator" content="EditPlus"> <meta name="Author&q

  • checkbox radiobutton submit the form 2010-04-29

    <? Xml version = "1.0"?> <! - Repeater / StaticLoop.mxml -> <S: Application xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: mx = "library: / / ns.adobe.com / flex / mx" xmlns: s = "library: / / ns.adobe

  • CheckBox in ListView result will not be triggered its OnItemClickListener 2010-06-22

    CheckBox in ListView result will not be triggered its OnItemClickListener The title is a bit long at it, I can not really worth mentioning the language before it is re-described open questions Wrote, ListView in each item can be displayed through ext

  • jquery get text, areatext, radio, checkbox, select the value of the 2010-07-09

    jquery get text, areatext, radio, checkbox, select the value, and other operations; 1. If we have the following page <Input type = "text" name = "textname" id = "text_id" value = ""> <! - The rest of your o

  • JQUERY access form form text, areatext, radio, checkbox, select the value 2010-08-02

    jquery get text, areatext, radio, checkbox, select the value, and other operations; 1. If we have the following page <Input type = "text" name = "textname" id = "text_id" value = ""> <! - The rest of your o

  • checkbox treegrid, rewritten treegrid, first as a checkbox 2010-08-03

    Project needs, modify the ext native treegrid, an increase in the first column a checkbox, checkbox function to do: 1. Support Select; 2. Support to select a parent node child node after it has started automatically selected; 3, the parent node is se

  • jquery select values, radio value, checkbox Value, radio selected 2010-08-09

    Jquery on the Radio, checkbox, select the following: jquery radio value, checkbox values, select values, radio check, var item = $('input[@name=items][@checked]').val(); Access to select the text of the selected items var item = $("select[@name=items

  • jQuery checkbox in the Select operation. anti-election, radio, select function 2010-08-20

    var item = $("select[name=items] option[selected]").text(); Or $("select[name=items]").find("option:selected").text(); The following is written under the version of jQuery 1.3.2 jquery radio value, checkbox values, select val

  • flex tree embedded in the cascade options checkBox 2010-09-02

    Can select the tree in the checkBox cascade package minntree { import flash.events.Event; import flash.events.MouseEvent; import mx.controls.Alert; import mx.controls.CheckBox; import mx.controls.Tree; import mx.controls.treeClasses.TreeItemRenderer;

  • jquery radio checkbox select operation 2010-09-10

    jquery radio value, checkbox values, select value and the selected (reference) Keywords: jquery jquery radio value, checkbox values, select values, radio check, checkbox is selected, select selected, and its associated radio access to a group of sele