> 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
> -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
> -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
>
> 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
r
> -Original Message-
> From: leledumbo [mailto:leledumbo_c...@yahoo.co.id]
> Sent: 07 August 2009 05:43
>
> > This should work:
> >
> >
> >
> >
> >
>
> Yes, that works. But should I manually maintain the number in the
> bracket?
> Is there anyway so that it can be automatically mainta
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
> 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
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
> This should work:
>
>
>
>
>
Yes, that works. But should I manually maintain the number in the bracket?
Is there anyway so that it can be automatically maintained? Because my app
allows to delete entries arbitrarily. For instance, consider this layout (+
is insert button, - is delete):
ent
On Mon, 03 Aug 2009 11:01:13 +0300, leledumbo
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:
--
--
PHP General Mailing List (http://www.php.net/)
To unsubsc
Justin Gruenberg wrote:
None
And if you didn't want it to show to the user (because they have to
make a choice anyway) . . . you can use this css:
input[value="None"]
{
display: none;
}
You should then always have a value to play with in PHP, and the user
doesn't see any extra clutter.
wh
> None
And if you didn't want it to show to the user (because they have to
make a choice anyway) . . . you can use this css:
input[value="None"]
{
display: none;
}
You should then always have a value to play with in PHP, and the user
doesn't see any extra clutter.
--
PHP General Mailin
Ashley M. Kirchner wrote:
I have this form.html:
text input
radio input1
radio input2
Then I have this script (form.php):
$val)
echo "$key = $val\n";
?>
If I simply submit the form empty, all I get back from the script is
the text input $key. The radio button doesn't show up. Why
That's because Radio Buttons and Check Boxes do not return anything if not
checked or selected.
So you gotta explicitly do it ur self. That is u gotta check for it's
validity and non-empiness.
e.g. in ur scenario
if(!isset($_POST['radio_test'])) { //print out all the options unselected }
else
{
Hi,
You solve the problem yourself: "the radio input does show up once one
of the radios is checked". When it is unchecked is isn't set...if you
need to assign it a value in any circumstances you should test it with
for
example (of course you may omit the ternary operator...isset() will do
th
- Original Message -
From: "Daniel Clark" <[EMAIL PROTECTED]>
To: "Andy B" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 07, 2004 4:22 PM
Subject: Re: [PHP] radio buttons checked or not
> My understanding is if the va
My understanding is if the variable "exists" then the radio button was
checked.
> i have this code:
>
> accesskey="y">Yes
>
> accesskey="n">No
> was just wondering if that was the right way to determine the state of a
> radio button...?
> if the value of $old['Type']="Annual" then the yes but
>Assuming $old['Type'] somehow comes from >$_REQUEST['eventtype'] (or is
>related to it), then yeah, that'll work.
no its coming from a db result from fetch_array() of which im having an
interesting problem with right now but thats in another post
--
PHP General Mailing List (http://www.php.net/
From: "Andy B" <[EMAIL PROTECTED]>
> i have this code:
>
> Yes
>
> accesskey="n">No
> was just wondering if that was the right way to determine the state of a
> radio button...?
> if the value of $old['Type']="Annual" then the yes button is checked...if
> not then the no button is checked inste
[snip]
i have this code:
Yes
No
was just wondering if that was the right way to determine the state of a
radio button...?
if the value of $old['Type']="Annual" then the yes button is
checked...if
not then the no button is checked instead...
[/snip]
Check for the value assigned to each
if("Annua
> he wants 3 radio buttons on a form .. something to the affect of:
> this is a general post
> this is an urgent post
> this is a message i need to post because it bothers me
>
> would this be the right setup for radio buttons and if so what is
> the best way to tell what one of them is checked wit
TECTED]>
Sent: Monday, February 24, 2003 1:29 AM
Subject: RE: [PHP] radio buttons
> Using a case statment would be the easyest way to tell which one was
> checked, but technicly one could check all three unless the value of name
is
> changed the same like ...
>
> this
> is a
Using a case statment would be the easyest way to tell which one was
checked, but technicly one could check all three unless the value of name is
changed the same like ...
this
is a general post
this
is
an urgent post
this is a
message i need to post because it bothers me
-Original Message--
#x27;re right !
- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "php" <[EMAIL PROTECTED]>; "David Jackson"
<[EMAIL PROTECTED]>
Sent: Monday, November 04, 2002 2:57 PM
Subject: Re: [PHP] radio buttons f
Rija wrote:
oups ... you're right !
- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "php" <[EMAIL PROTECTED]>; "David Jackson"
<[EMAIL PROTECTED]>
Sent: Monday, November 04, 2002 2:57 PM
S
oups ... you're right !
- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "php" <[EMAIL PROTECTED]>; "David Jackson"
<[EMAIL PROTECTED]>
Sent: Monday, November 04, 2002 2:57 PM
Subject: Re: [
There is no reason to put brackets behind the name of the radio element. The brackets are neccessary for multi-select elements like checkboxes, but radio buttone are a single select element.
Your if statement should be a while loop.
I'm sure you don't want to set this ( value=acct[] ) as the val
I don't think so,
Put the bracket with your radio's name not with your the value///
For example :
print "{$row['acct']}" ...
and so one/
- Original Message -
From: "David Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 04, 2002 1:15 PM
Subject: [PHP] radio butt
Actually it does explain it, you set the variable to false, which of course
is 0, so that's why you had a 0 :)
Also a good way of seeing if the variable is set, no equaling 0, "", " ",
false, etc is by using the empty function if (empty($empleados))
Glad you figured it out though!
Cheers
Rick
> Just a hunch... but try value="1–24" and see how that works, so
> basically substitute "-" for "–"
>
> I can't see the rest of your code and what else you might be appending to
> $msgtxt, so it could be something else...
Yes it was something else. I did a wrong comparison with the variable:
$e
Just a hunch... but try value="1–24" and see how that works, so
basically substitute "-" for "–"
I can't see the rest of your code and what else you might be appending to
$msgtxt, so it could be something else...
Rick
> Used HTML code:
>
>
>
>
>
>
> PHP code:
> $msgtxt .= "\r\nEmpleados:
31 matches
Mail list logo