Page 1 of 1

Problems with dynamically created checkbox

Posted: Thu Dec 07, 2006 1:18 am
by tolearn
Hi,

Im trying to create multiple checkboxes dynamically.

I need to fetch the value if the check box selected in the next page.

Is there any solution.

Re: Problems with dynamically created checkbox

Posted: Thu Dec 07, 2006 1:47 am
by hrubos
tolearn wrote:Hi,

Im trying to create multiple checkboxes dynamically.

I need to fetch the value if the check box selected in the next page.

Is there any solution.
If I understand your question, I think you should insert value by cliking checkbox button and select in a new page.

Posted: Thu Dec 07, 2006 1:05 pm
by feyd
The checkbox status will be available on the next page via it's name. If you've created a checkbox group (where there are two or more checkboxes with the same name) then it is easier to name with similar to "foo[]". The important part being the brackets. This will cause PHP to build an array of the values given to it by the browser. Sometimes being a bit more specific is preferential so a name of "foo[id]" where "id" is the unique part for each checkbox will set which element name each checkbox is given inside the resulting array.

I personally use the value attribute most often to signify which checkboxes were actually selected.