HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Multi Use Radio Buttons
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
infrastructure



Joined: 12 Oct 2008
Posts: 4

PostPosted: Mon Oct 13, 2008 2:20 pm     Multi Use Radio Buttons Reply with quote

I have several options to choose from on this page http://www.wornpantygirls.com/acctregistration.php

I need people to be able to select more than one. But for now it only allows you to select 1 out of the 22 Radio buttons.

I would appreciate if someone that is more fluent in PHP than I am could take a look at the page and source code and see what my problem is that is keeping this from happening.


Thank You
PayneLess Designs



Joined: 28 Feb 2007
Posts: 1417
Location: Biloxi, MS

PostPosted: Mon Oct 13, 2008 2:39 pm     Reply with quote

Radio buttons (type="radio") only allow one selection. For multiple selection, the HTML code needs to be change to reflect their use so more than one selection can be made. The processing form may have to be changed to allow their use. Not sure on this.

See:
Multiple Select box, Select multiple Items from Menu.List box
List Box - Multiple Select
jonhel



Joined: 07 Oct 2008
Posts: 10
Location: Adelaide, South Australia

PostPosted: Mon Oct 13, 2008 3:37 pm     Reply with quote

This isn't a PHP issue but related to the html in use on the page.

Looking at the underlying html, the buttons all refer to input name="group1".

You could get it to accept more than one entry if you used different input names but not sure how practical that is for you.

Jonathan
infrastructure



Joined: 12 Oct 2008
Posts: 4

PostPosted: Mon Oct 13, 2008 5:38 pm     Reply with quote

jonhel wrote:
This isn't a PHP issue but related to the html in use on the page.

Looking at the underlying html, the buttons all refer to input name="group1".

You could get it to accept more than one entry if you used different input names but not sure how practical that is for you.

Jonathan


To do that there is this code in the upper portion of the page '$_POST[group1]',now(),' would I continue from there with '$_POST[group2]',now(),' etc and change the code around the Radio buttons to change the different groups per block of buttons I want to be separated so choices could be selected ?
jonhel



Joined: 07 Oct 2008
Posts: 10
Location: Adelaide, South Australia

PostPosted: Tue Oct 14, 2008 8:22 pm     Reply with quote

That sounds correct from what you've described. I would give it a go and see if it produces the results you want Smile

Jonathan
PayneLess Designs



Joined: 28 Feb 2007
Posts: 1417
Location: Biloxi, MS

PostPosted: Tue Oct 14, 2008 9:00 pm     Reply with quote

This is just a rough code example of a form with radio buttons and multiple selections:
Code:
<form method="POST" action="/cgi-bin/form_processor.cgi">
<p><input type="hidden" name="subject" value="Form Demo"></p>
<p><input type="hidden" name="redirect" value="/library/demo/thform.html"></p>

<p>Name: <input type="text" name="realname" size="21"></p>
<p>Email: <input type="text" name="email" size="21"></p>

<p>Select one:<br>This is<br><input type="radio" name="x_Visitor wants" value="order"> An order for services.<br><input type="radio" name="x_Visitor wants" value="information" checked> A request for information.</p>

<p>Select as many as apply:<br>
<input type="checkbox" name="x_1 letter chosen" value="a"> A<br>
<input type="checkbox" name="x_2 letter chosen" value="b"> B<br>
<input type="checkbox" name="x_3 letter chosen" value="c" checked> C</p>

<p>Your message goes here:<br>
<textarea name="message" cols="35" rows="5"></textarea></p>
<p><input type="submit" value="Send"></p>
</form>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial