By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

Form: Accessing values of array of checkboxes

P: n/a
Hello,

I have a form with a dynamic checkbox structure:

for ($ix=1; $ix<=$anzahl; $ix++)
{
echo "<TR><TD align=right>$ix.</TD><TD ALIGN=\"center\">";
echo "<input type=\"radio\" name=\"partei[$ix]\" value=\"Sel1\"></TD><TD
align=\"center\">";
echo "<input type=\"radio\" name=\"partei[$ix]\" value=\"Sel2\"></TD>";
}

At least at the screen everything works as was supposed to do.

I send the form with POST.

How do I access the array to work with the state of the checkboxes?

My tries with ($ix=loop count)

echo $_POST['partei[$ix]'];

oder

echo $_POST[$partei[$ix]];

don't give me a value back.

Thanks Kay
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Kay Molkenthin schrieb:
How do I access the array to work with the state of the checkboxes?


Might I suggest the german FAQ?

11.10. Wie kann man Checkboxen verarbeiten?
http://www.dclp-faq.de/q/q-formular-checkbox.html

Regards,
Matthias
Jul 17 '05 #2

P: n/a
On Sat, 12 Jun 2004 22:34:56 +0200, Kay Molkenthin
<Ka************@e-realm.de> wrote:
My tries with ($ix=loop count)

echo $_POST['partei[$ix]'];


try echo $_POST['partei'][$ix];

Greetings

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
http://www.heddesheimer.de/coaching/
Jul 17 '05 #3

P: n/a

"Kay Molkenthin" <Ka************@e-realm.de> wrote in message
news:op**************@news.cis.dfn.de...
Hello,

I have a form with a dynamic checkbox structure:

for ($ix=1; $ix<=$anzahl; $ix++)
{
echo "<TR><TD align=right>$ix.</TD><TD ALIGN=\"center\">";
echo "<input type=\"radio\" name=\"partei[$ix]\" value=\"Sel1\"></TD><TD
align=\"center\">";
echo "<input type=\"radio\" name=\"partei[$ix]\" value=\"Sel2\"></TD>";
}


I may have missed something here, BUT, you are using radio buttons in this
form not checkboxes.
May cause you probs :)

PhilM
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.