|
Posted by Miguel Cruz on 08/07/06 19:21
"Sonnich" <sonnich.jensen@elektrobit.com> wrote:
> I found that it should work here too:
>
> if( !(isset($_POST[$part1[$i]]) && ($_POST[$part1[$i]] ==
> "")) )
> echo " checked";
> else
> echo "";
>
> Idea: checkbox is default checked, but only if set and set to nothing
> it is not set.
> Boolean algebra. Only if set, and set to nothing, then it is not set.
>
> But by some reason it does not work. I have done this a 147533 times,
> and here it does not work. Why?
Are you sure you want $_POST[$part1[$i]] ? Maybe $_POST[$part1][$i] ?
Hard to know without understanding how your form and code look, but my
proposed alternative is more typical for dealing with checkboxes.
If I am correct in my theory, turning on E_ALL error reporting would
have drawn attention to the issue.
miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Navigation:
[Reply to this message]
|