[thelist] checked vs. unchecked checkboxes

Mark Joslyn Mark.Joslyn at SolimarSystems.com
Tue Oct 19 15:49:18 CDT 2004


<snip>
That's not true.  Checkboxes (or any form field types except radio buttons,
for that matter) that share the same name send the values of all successful
form controls to the serve as a comma-delimited list.  Perhaps your PHP
processing page is doing something funky to the returned value before you
start working with it that's causing you to lose everything but the last
entry.  However, I'd advise you to take a look at it again.
</snip>

The only way I can return all the "successful" form controls is to have all
of them use different names. If I use "chkIn" as the checkbox name for all
my checkboxes, I only receive one value - the last value.

I output the posted variable to the screen before any PHP processing was
done on it and it is only posting one variable - the last one declared.

The form is structured this: (2 columns of checkboxes)

<input type="checkbox" name="chkIn" value="<? echo $repLabel . "," . $repNum
. "," . $repFlags; ?>" />

<input type="checkbox" name="chkIn" value="<? echo $repLabel . "," . $repNum
. "," . $repFlags; ?>" />

checked vs. unchecked is done by checking the $repFlags variable - So my
initial form is a mixture of checkboxes that are already checked and some
that are unchecked.

If I select an unchecked checkbox, the value I return is the last of the
checked checkboxes. So I need a way to target specific checkboxes - hence
the unique names.

Any thoughts?

markJ

p.s. - thanks for the help!!







More information about the thelist mailing list