|
Posted by Hemanth on 03/23/06 23:33
Try this,
In abc.php
> <form action="TestCheckbox.php" method="POST" name="TestCheck">
> <INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="100" />
> <INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="200" />
> <INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="300" />
> <INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="400" />
> <INPUT Type="CHECKBOX" Name="RecordNumber[]" Value="500" />
> <input type=submit name="submit">
> </form>
In TestCheckbox.php
$recordNumbers = $_POST['RecordNumber'];
//Displays all checked values
foreach($recordNumbers as $number) echo $number . "<br />";
HTH,
Hemanth
niftyhawk@gmail.com wrote:
> Hi All,
>
> I have a php page say "abc.php" generating the following HTML. I am
> posting the form action to another php page say "TestCheckbox.php".
>
> How do I retrieve in "TestCheckbox.php" which checkboxes are checked in
> "abc.php"?
>
> abc.php
> ========
>
> <form action="TestCheckbox.php" method="POST" name="TestCheck">
> <INPUT Type="CHECKBOX" Name="RecordNumber" Value="100">
> <INPUT Type="CHECKBOX" Name="RecordNumber" Value="200">
> <INPUT Type="CHECKBOX" Name="RecordNumber" Value="300">
> <INPUT Type="CHECKBOX" Name="RecordNumber" Value="400">
> <INPUT Type="CHECKBOX" Name="RecordNumber" Value="500">
> <input type=submit name="submit">
> </form>
>
> Note: I do not want to use any javascript in abc.php. Any new code
> should be present in "TestCheckbox.php" only.
>
> Thanks,
Navigation:
[Reply to this message]
|