RE: [PHP] Radio buttons problem

2009-08-11 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 field

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

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 indexes -- just iterate over the resulting

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 one

Re: [PHP] Radio buttons problem

2009-08-07 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 it

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

Re: [PHP] Radio buttons problem

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

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-03 Thread Ollisso
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'

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread Hegeds Balzs
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 ?php $chkbox1 = (isset($_POST[radio_test])) ? true : false; ? for example (of

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 Janet Valade
Ashley M. Kirchner wrote: I have this form.html: form method=post action=form.php text input input type=text name=input_testbr / radio input1 input type=radio name=radio_test value=test1 / radio input2 input type=radio name=radio_test value=test2 / input type=submit value=Submit /form Then

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread Justin Gruenberg
None input type=radio checked name=radio_test value=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

Re: [PHP] radio buttons in $_POST

2005-04-23 Thread M. Sokolewicz
Justin Gruenberg wrote: None input type=radio checked name=radio_test value=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

RE: [PHP] radio buttons checked or not

2004-04-07 Thread Jay Blanchard
[snip] i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just wondering if that was the right way to determine the state of a radio button...? if the

Re: [PHP] radio buttons checked or not

2004-04-07 Thread John W. Holmes
From: Andy B [EMAIL PROTECTED] i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just wondering if that was the right way to determine the

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 Daniel Clark
My understanding is if the variable exists then the radio button was checked. i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just

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 variable exists then the radio button was checked. i

Re: [PHP] radio buttons

2003-02-24 Thread Gonzo
he wants 3 radio buttons on a form .. something to the affect of: input type=radio name=general value=this is a general statement?this is a general post input type=radio name=urgent value=this is an urgent messagethis is an urgent post input type=radio name=concern value=this is bothering

RE: [PHP] radio buttons

2003-02-23 Thread Dennis Cole
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 ... input type=radio name=priority value=this is a general statement?this is a general post input type=radio name=priority

Re: [PHP] radio buttons

2003-02-23 Thread Sunfire
=postprayer.htmclick here/a to go back to the form to re-enter your post. /body /html ?php } //finnish script here.. ? - Original Message - From: Dennis Cole [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 24, 2003 1:29 AM Subject: RE: [PHP] radio buttons

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 td width=2input type=radio name=gl_acct[] value=$row['acct']{$row['acct']}/td ... and so one/ - Original Message - From: David Jackson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent:

Re: [PHP] radio buttons from MySQL query?

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

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: [PHP] radio buttons from MySQL query? There is no reason to put

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread David Jackson
PROTECTED] Sent: Monday, November 04, 2002 2:57 PM Subject: Re: [PHP] radio buttons from MySQL query? 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

Re: [PHP] radio buttons from MySQL query?

2002-11-03 Thread John Nichel
] Sent: Monday, November 04, 2002 2:57 PM Subject: Re: [PHP] radio buttons from MySQL query? 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

Re: [PHP] radio buttons

2001-09-20 Thread RNie
Just a hunch... but try value=1ndash;24 and see how that works, so basically substitute - for ndash; 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:

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