[thelist] checked vs. unchecked checkboxes

Mark Joslyn Mark.Joslyn at SolimarSystems.com
Tue Oct 19 13:54:26 CDT 2004


I am trying to figure out how to send an HTML form to a PHP processing page,
but only post the variables for checkboxes that have changed.

The form consists of two columns of checkboxes:

	Column One = name="chkIn<? echo $repNum; ?>" value="<? echo
$repValue; ?>"
	Column Two = name="chkEmail<? echo $repNum; ?>" value="<? echo
$repValue; ?>"

The initial state of the checkbox is set via flags obtained from a web
service. So the checkboxes can be in any combination of checked or unchecked
states.

I have a JavaScript script that automatically submits the page to the PHP
processing page once a user clicks on a checkbox, unfortunately ALL the
"checked" boxes get posted to the PHP processing page.

Is there a way to ascertain which checkbox was changed, and only post that
variable?

Naming all the checkboxes the same name did not work since it always sent
the last checkbox in the list. That is why I append the $repName to the end
of the checkbox name to give it a distinct name.

Any help would be appreciated.

Thanks,

markJ



More information about the thelist mailing list