Unless, of course, what you have is
name[], email[], sex[0]
name[], email[], sex[1]
name[], email[], sex[2]
Yep, that's exactly what I have.
If it's important to you that the indexes match across name[], email[] and
sex[], then you must supply
them explicitly for every field
Why do you? There's no reason you *have* to have consecutive indexes --
just iterate over the resulting array with foreach, and there's no
problem.
There is, the entries are grouped by its index. So, I group name[0],
email[0], and sex[0] as one. The problem if I don't maintain the index for
-Original Message-
From: leledumbo [mailto:leledumbo_c...@yahoo.co.id]
Sent: 10 August 2009 11:11
To: php-general@lists.php.net
Subject: RE: [PHP] Radio buttons problem
Why do you? There's no reason you *have* to have consecutive
indexes --
just iterate over the resulting
-Original Message-
From: leledumbo [mailto:leledumbo_c...@yahoo.co.id]
Sent: 10 August 2009 11:11
To: php-general@lists.php.net
Subject: RE: [PHP] Radio buttons problem
There is, the entries are grouped by its index. So, I group name[0],
email[0], and sex[0] as one
you will have to manually maintain the number in the bracket. but you
can try using a template engine like smarty, and use a for loop to
take care of the numbers in the brackets
Well.. the entries are inserted / deleted dynamically using JavaScript (to
avoid unnecessary refresh). Why can't it
you dont seem to understand how radio buttons work. they treat
name=sex[][] as a single group. and you can select only one element
in that group.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-Original Message-
From: leledumbo [mailto:leledumbo_c...@yahoo.co.id]
Sent: 07 August 2009 05:43
This should work:
input type='radio' name='sex[1]' value='1'
input type='radio' name='sex[1]' value='2'
input type='radio' name='sex[2]' value='1'
input type='radio'
This should work:
input type='radio' name='sex[1]' value='1'
input type='radio' name='sex[1]' value='2'
input type='radio' name='sex[2]' value='1'
input type='radio' name='sex[2]' value='2'
Yes, that works. But should I manually maintain the number in the bracket?
Is there anyway so that
you will have to manually maintain the number in the bracket. but you
can try using a template engine like smarty, and use a for loop to
take care of the numbers in the brackets
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, 03 Aug 2009 11:01:13 +0300, leledumbo leledumbo_c...@yahoo.co.id
wrote:
How can I make a radio button in one entry to behave independently from
the
one in another so that it can be accessed as name and email above?
This should work:
input type='radio' name='sex[1]' value='1'
10 matches
Mail list logo