473,382 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Form: Accessing values of array of checkboxes

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
3 2909
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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Craig Keightley | last post by:
I have the following form <FORM NAME="form1" METHOD="POST"> <?php do { ?> <input name="approve" type="checkbox" id="approve" value="<?php echo $row_rs; ?>"> <select name="select"> <option...
8
by: Simon | last post by:
Hey folks, I need some of your expertiese again. I am creating a survey form and need some help gathering the results of a question that has checkboxes. There are four options for one of the...
21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
7
by: Dan | last post by:
(Using Classic ASP & MS Access) I have a page that has 120 fields on it (mostly checkboxes). I cannot split this into smaller pages. So what i want to do is write a class that handles this. in...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
4
by: Cerebral Believer | last post by:
Hi I need help! Forgive me I am a PHP newbie. I have a small script that enables me to send a form from an HTML page. I want to use the HTML formatted form because the design of my website is...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
4
faugustin
by: faugustin | last post by:
Hi, I have a problem. I have av form with textfields, textareas and a vector type fieldset of checkboxes. Everything but the checkboxes works fine, they result in "array" in the field in the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.