Posted by Martin Jay on 04/24/06 16:02
In message <1145878532.101141.5090@e56g2000cwe.googlegroups.com>,
wesley@ispace.co.za writes
>I have tried that also. But the problem is that the value of the
>variable gets created dynamically.
>The problem is that i have an unlimited number of checkboxes on one
>page. So i am using an array to name them. I want to retriev the values
>from the checkboxes using another script. But, i cannot seem to
>retrieve these values.
Presumably you mean your HTML code contains code similar to this for
each checkbox:
<input type="checkbox" name="delete[]" value="1">
<input type="checkbox" name="delete[]" value="2">
<input type="checkbox" name="delete[]" value="3">
etc
After your form has been posted 'delete' is an array and can be used in
the following way:
$_POST['delete'][0];
this will contain the 'value' of he first checkbox that was ticked.
$_POST['delete'][1];
will contain the 'value' of the second checkbox that was ticked.
--
Martin Jay
Navigation:
[Reply to this message]
|