Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > PHP Programming
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-05-2010, 07:12 AM
  #1
simon_porter00
Novice (Level 1)
 
Join Date: Mar 2010
Posts: 5
iTrader: (0)
simon_porter00 is an unknown quantity at this point
Can select multiple radio buttons at once on a form

Hello All,
I'm creating a form which has got several parts, divided by tables, which are radio buttons, check boxes etc. All the radio button tables work well with the exception of one where it lets you choose all three options or two, as if they were checkboxes.

The code is:
PHP Code:
<div class="roundedcornrboxorange">
   <
div class="roundedcornrtoporange"><div></div></div>
      <
div class="roundedcornrcontentorange">
<
table width="100%">
<
tr>
<
td colspan="3"><h3>Which level do you think youre currently are?</h3></td>
</
tr>
<
tr>
<
td width="30%"><input type="radio" name="level[beginner]" id="beginner" value="1"/> Beginner</td>
<
td width="30%"><input type="radio" name="level[intermediate]" id="intermediate" value="1"/> Intermediate</td>
<
td width="30%"><input type="radio" name="level[advanced]" id="advanced" value="1"/> Advanced</td>
</
tr>
</
table>

      </
div>
   <
div class="roundedcornrbottomorange"><div></div></div>
</
div
Does anyone have an idea what could be going wrong?

The css (in case it helps) is:

PHP Code:
.roundedcornrboxorange {
margin5px 0 0 0;
width800px;
clearboth;
   
background#ff7b06 url(../images/roundedcornr190406grad.gif) repeat-x top left;
}
.
roundedcornrtoporange div {
   
backgroundurl(../images/roundedcornr190406tl.gifno-repeat top left;
}
.
roundedcornrtoporange {
   
backgroundtransparent url(../images/roundedcornr190406tr.gifno-repeat top right;
}
.
roundedcornrbottomorange div {
   
backgroundurl(../images/roundedcornr190406bl.gifno-repeat bottom left;
}
.
roundedcornrbottomorange {
   
backgroundtransparent url(../images/roundedcornr190406br.gifno-repeat bottom right;
}

.
roundedcornrtoporange div, .roundedcornrtoporange,
.
roundedcornrbottomorange div, .roundedcornrbottomorange {
   
width100%;
   
height10px;
   
font-size1px;
}
.
roundedcornrcontentorange margin0 10px; } 
Many thanks in advance
simon_porter00 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-05-2010, 03:30 PM
  #2
karthimx
Lord (Level 16)
 
Join Date: Jun 2008
Location: India
Posts: 558
iTrader: (0)
karthimx is on a distinguished road
why can't you use checkbox then?
karthimx is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-05-2010, 04:57 PM
  #3
combbat21
Swordman (Level 9)
 
Join Date: May 2010
Posts: 85
iTrader: (0)
combbat21 is an unknown quantity at this point
You must put the same "name" for all the input radios so the page recognize them as a group.

HTML Code:
table width="100%"> 
<tr> 
<td colspan="3"><h3>Which level do you think you're currently are?</h3></td> 
</tr> 
<tr> 
<td width="30%"><input type="radio" name="level" id="beginner" value="1" checked="checked"/> Beginner</td> 
<td width="30%"><input type="radio" name="level" id="intermediate" value="1"/> Intermediate</td> 
<td width="30%"><input type="radio" name="level" id="advanced" value="1"/> Advanced</td> 
</tr> 
</table> 
combbat21 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2010, 12:22 AM
  #4
simon_porter00
Novice (Level 1)
 
Join Date: Mar 2010
Posts: 5
iTrader: (0)
simon_porter00 is an unknown quantity at this point
Quote:
why can't you use checkbox then?
Hi Karthimx, the answer to the question is either one or the other. You are either beginner, intermediate or advanced at a language, you can't be both a beginner and advanced, that's why it has to be radio buttons.

Hi Combbat21,
It could be that, I'll try it out. My ex-developer looks to have tried the radio button as a type of variable.
simon_porter00 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2010, 12:40 AM
  #5
simon_porter00
Novice (Level 1)
 
Join Date: Mar 2010
Posts: 5
iTrader: (0)
simon_porter00 is an unknown quantity at this point
UPDATE****

Have tried it out and getting rid of the [] variable made the radio buttons work, however, It's now causing all kinds of problems with the php on the search page. Hmm, I think that rather than change all the backend php coding for this I better change this particular functionality to php rather than html
simon_porter00 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-09-2010, 10:13 AM
  #6
revolutionary20
Catapulted
 
Join Date: Oct 2010
Posts: 2
iTrader: (0)
revolutionary20 is an unknown quantity at this point
if u having problem in php so plz click here
[link removed]
there is many things about web hosting, languages, php, shopping carts, seo etc
revolutionary20 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-09-2010, 10:45 AM
  #7
darksidepuffin
Absolutely Irrelephant
 
darksidepuffin's Avatar
 
Join Date: Jan 2001
Location: Nova Scotia, Canada
Posts: 5,623
iTrader: (0)
darksidepuffin is a jewel in the roughdarksidepuffin is a jewel in the roughdarksidepuffin is a jewel in the rough
revolutionary20:

Spamming is not allowed here. I have edited both of your spam posts to remove your link. Should you be found spamming again, you will be permanently banned.

Further more, your link completely lacks relevance to either topic, since it's completely devoid of anything useful to either thread.

Consider this your one and only warning.

DarksidePuffin
Senior Moderator
darksidepuffin is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-09-2010, 10:50 AM
  #8
darksidepuffin
Absolutely Irrelephant
 
darksidepuffin's Avatar
 
Join Date: Jan 2001
Location: Nova Scotia, Canada
Posts: 5,623
iTrader: (0)
darksidepuffin is a jewel in the roughdarksidepuffin is a jewel in the roughdarksidepuffin is a jewel in the rough
simon_porter00:

Using array notation (e.g: name="language[]") for a radio button is largely pointless, because they are, as you mentioned, "either/or" selections. This really only useful for checkboxes or other fields (file uploads, for example) that can have a number of entries. The example given in your first post seems to me to be more suitable to checkboxes.

That being said, we would need to see the current form and the backend php code in order to help you further.
__________________
DarksidePuffin, Senior Moderator
Technical Development and Deployment Specialist
Subliminal Development
Current Projects: The Animal Rescue Index|CubedPuffin (blog)
darksidepuffin is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-14-2010, 07:33 AM
  #9
scoutt
Mister Admin to you
 
scoutt's Avatar
 
Join Date: Jul 2001
Posts: 33,095
iTrader: (0)
scoutt is a glorious beacon of lightscoutt is a glorious beacon of lightscoutt is a glorious beacon of lightscoutt is a glorious beacon of lightscoutt is a glorious beacon of light
You can change the html to be this

HTML Code:
<td width="30%"><input type="radio" name="level" id="beginner" value="Beginner"/> Beginner</td>
<td width="30%"><input type="radio" name="level" id="intermediate" value="Intermediate"/> Intermediate</td>
<td width="30%"><input type="radio" name="level" id="advanced" value="Advanced"/> Advanced</td> 
But as the friendly puffin suggests, you may have to change the php side of things just a bit.
__________________
Have a Script or Snippet you want to share?

WWW Standards: HTML 4.01,
HTML 5, CSS2.1, CSS3, XHTML 1.0
PHP Standards: PHP Standards
scoutt is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 02:33 AM.

   

Mascot team created by Drawshop.com | Web Hosting

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.