RE: [PHP] Radio buttons problem

2009-08-10 Thread leledumbo
> 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

RE: [PHP] Radio buttons problem

2009-08-10 Thread tedd
> -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

RE: [PHP] Radio buttons problem

2009-08-10 Thread Ford, Mike
> -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 >

RE: [PHP] Radio buttons problem

2009-08-10 Thread leledumbo
> 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

RE: [PHP] Radio buttons problem

2009-08-07 Thread Ford, Mike
> -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

Re: [PHP] Radio buttons problem

2009-08-07 Thread kranthi
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

Re: [PHP] Radio buttons problem

2009-08-06 Thread leledumbo
> 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

Re: [PHP] Radio buttons problem

2009-08-06 Thread kranthi
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

Re: [PHP] Radio buttons problem

2009-08-06 Thread leledumbo
> 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

Re: [PHP] Radio buttons problem

2009-08-03 Thread Ollisso
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

[PHP] Radio buttons problem

2009-08-03 Thread leledumbo
I'm creating a form with variable number of entries (user controlled) where each entry consists of some input fields. For most input types, appending [] to their names is enough to allow me processing each entry. So, for instance, if there are 3 entries with field name[] and email[], they can be a

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread M. Sokolewicz
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

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread Justin Gruenberg
> 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

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread Janet Valade
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

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread M Saleh EG
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 {

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread Hegedűs Balázs
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

[PHP] radio buttons in $_POST

2005-04-23 Thread Ashley M. Kirchner
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 is that and how can I ha

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Andy B
- 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

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Daniel Clark
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

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Andy B
>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/

Re: [PHP] radio buttons checked or not

2004-04-07 Thread John W. Holmes
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

RE: [PHP] radio buttons checked or not

2004-04-07 Thread Jay Blanchard
[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

[PHP] radio buttons checked or not

2004-04-07 Thread Andy B
hi... 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... -- PHP General Mailing List (http://www.php.net/) To u

Re: [PHP] radio buttons

2003-02-24 Thread Gonzo
> 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

Re: [PHP] radio buttons

2003-02-23 Thread Sunfire
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

RE: [PHP] radio buttons

2003-02-23 Thread Dennis Cole
- From: Sunfire [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 1:30 AM To: [EMAIL PROTECTED] Subject: [PHP] radio buttons oh sorry i forgot in the last message too.. he wants 3 radio buttons on a form .. something to the affect of: this is a general post this is an urgent post this

[PHP] radio buttons

2003-02-23 Thread Sunfire
oh sorry i forgot in the last message too.. 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

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread John Nichel
#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

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread David Jackson
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

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread rija
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: [

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread John Nichel
Original Message - From: "David Jackson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 04, 2002 1:15 PM Subject: [PHP] radio buttons from MySQL query? How do I go about building radio buttons using the results of a MySQL query. The record lay

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread rija
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: Mo

[PHP] radio buttons from MySQL query?

2002-11-03 Thread David Jackson
How do I go about building radio buttons using the results of a MySQL query. The record layout looks like this: acct cat description I want to use acct as the value="acct" in the input statement for the radio box. The code below almost works? TIA, David $header = mysql_query ("SELECT * FROM

Re: [PHP] radio buttons

2001-09-20 Thread Richard Baskett
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

Re: [PHP] radio buttons

2001-09-20 Thread RNie
> 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

Re: [PHP] radio buttons

2001-09-20 Thread Richard Baskett
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:

[PHP] radio buttons

2001-09-20 Thread RNie
Used HTML code: PHP code: $msgtxt .= "\r\nEmpleados: $empleados"; Whatever radio button is selected, the $msgtxt becomes: "Empleados 0" As far as I know the variable $empleados should have the choice that was made in the form. Why did it return "0"? What did I do wrong? Note that all other