Page 1 of 1

Radio buttons.

Posted: Fri Sep 15, 2006 11:56 pm
by gkwhitworth
Ok, I have my form pretty much completed. I need for you to guys to help me out with radio buttons. My site is
http://www.gkwinspired.com/contact/web_new.php

Alright, the form works beautifally except for the radio buttons, they don't send information through. I did some searching through this forum and found that radio buttons are sent as arrays, but no actual help on how to pull this off.

--
Greg

Posted: Sat Sep 16, 2006 12:10 am
by aaronhall
You're site appears to be down, but check out http://www.echoecho.com/htmlforms10.htm -- make sure you're using the input tags correctly. The radio inputs are accessible to PHP as variables, not arrays. The selected radio button's value property is sent to PHP in a $_GET or $_POST entry with the key being the input's name property.

<input type="radio" name="groupOfButtons" value="foo"> Foo
<input type="radio" name="groupOfButtons" value="bar"> Bar

If "Bar" is selected, $_GET['groupOfButtons'] or $_POST['groupOfButtons'] (depending on your form's "method" property) will return "bar".

Posted: Sat Sep 16, 2006 12:19 am
by gkwhitworth

Posted: Sat Sep 16, 2006 12:30 am
by aaronhall
You'll want to use a checkbox for boolean options -- radio buttons are used to select one of a list. Check out http://www.globalissa.com/articles/articleCheckbox.php.

IT WORKS! Now on to the mail() function.

Posted: Sat Sep 16, 2006 1:12 am
by gkwhitworth
I changed them....it works now...thanks aaron.

--
Greg

Posted: Sat Sep 16, 2006 8:04 am
by Luke
hey nice site design... very clean! one suggestion though... when you click on the main navigation buttons, that particular page name replaces "home" in the uhh active page thing on the left. I like that little feature... it's nice... but I would move the box to the pagename instead of moving the pagename to the box. It confuses people when links change position from page to page. Othat than that I really like your design!

this is what I mean

[/offtopic]

Thanks

Posted: Sat Sep 16, 2006 2:16 pm
by gkwhitworth
Thanks....I knew what you were getting at....I hope that you didn't photoshop that too long. :) Anyways, I have been planning on redoing the template anyways for other reasons, but that was my first seamless CSS design....only 2 pictures total in the template.

--
Greg