Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming gpu hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: HTML radio buttons are allowing multiple instead of single selection

Reply  
Thread Tools
andynic's Avatar
Computer Specs
Member with 122 posts.
 
Join Date: May 2007
Location: Amsterdam
Experience: Beginner
13-Mar-2010, 06:00 AM #1
Solved: HTML radio buttons are allowing multiple instead of single selection
Hi,

I have a series of rows in a table like the ones shown below.

The radio buttons are allowing the user to make multiple selections rather than just one.
Any idea why this is the case? I want radio buttons so that the user can select just one.

The idea behind the use of both radios and checkboxes is to allow the user to select just one image as a Thumbnail (the radios) to be stored in a table in a local MySql database and many images to be stored in another table in the same DB (checkboxes). (Am using Perl CGI).

Thanks for your help,
Andy

<table>
<tr>
<td style="text-align:center">
<input type="radio" name="MITM_NEWslctItmThmbn56" value="selected" >
</td>
<td style="text-align:center">
<input type="checkbox" name="MITM_NEWslctItmImg56" value="selected" >
</td>
<td align=center title="http://lh4.ggpht.com/_BfSHtcWNuCI/SxGxKEWu4NI/AAAAAAAABAI/fZOZK0z794U/FirstShoot2009-08-06.JPG">
<IMG name="img56"
style="cursorointer"
src="http://lh4.ggpht.com/_BfSHtcWNuCI/SxGxKEWu4NI/AAAAAAAABAI/fZOZK0z794U/s128/FirstShoot2009-08-06.JPG"
width="37.5" height="50"
alt="If image does not appear, try clicking this space"
title=""
onClick="window.open('http://lh4.ggpht.com/_BfSHtcWNuCI/SxGxKEWu4NI/AAAAAAAABAI/fZOZK0z794U/FirstShoot2009-08-06.JPG','newWin', 'height=1600, width=1200, top=0, left=0');">
</td>
<td style="text-align:center">
<textarea rows="1" cols="25">test update</textarea><br>
<input style="text-align:left" type="text" size="27" name="MITM_NEWalbmImgCptn56" value="This is a new caption with spaces">

</td>
<td> <!-- This hidden preserves the info about the image for use in screen refresh and filling in the selected list -->
<!-- See subroutine xferNewItemSlctdItmImgsToArray for record layout -->
<input type="hidden" name="MITM_NEWimgInfo56"
value="3#C#test update#C#http://lh4.ggpht.com/_BfSHtcWNuCI/SxGxKEWu4NI/AAAAAAAABAI/fZOZK0z794U/FirstShoot2009-08-06.JPG#C#1200#C#1600#C#http://lh4.ggpht.com/_BfSHtcWNuCI/SxGxKEWu4NI/AAAAAAAABAI/fZOZK0z794U/s128/FirstShoot2009-08-06.JPG#C#37.5#C#50">
</td>
</tr>
... MANY ROWS LIKE THE ABOVE FOLLOWED BY

<tr>
<td> <!-- This hidden preserves the number of images that have been displayed -->
<!-- See subroutine xferNewItemSlctdItmImgsToArray -->
<input type="hidden" name="MITM_NEWnrOfAlbmImgs" value="58">
</td>
</tr>
</table>
andynic's Avatar
Computer Specs
Member with 122 posts.
 
Join Date: May 2007
Location: Amsterdam
Experience: Beginner
13-Mar-2010, 06:08 AM #2
Problem solved!
I was giving each radio button in the list a different name.
Sorry about that.
Andynic
tomdkat's Avatar
Computer Specs
Distinguished Member with 7,127 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
14-Mar-2010, 01:23 AM #3
Try giving each radio button in the list the same name and see if your problem goes away.

Peace...
mei2050133's Avatar
Junior Member with 1 posts.
 
Join Date: Apr 2010
08-Apr-2010, 10:11 AM #4
I never knew that HTML radio buttons are allowing multiple instead of single selection in the past,it is a good news,thank you.
andynic's Avatar
Computer Specs
Member with 122 posts.
 
Join Date: May 2007
Location: Amsterdam
Experience: Beginner
08-Apr-2010, 11:21 AM #5
No it's not. I was misusing the button by giving each button a different name.
Better to use check boxes for multiple selections, not radio buttons.
Andynic
tomdkat's Avatar
Computer Specs
Distinguished Member with 7,127 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
08-Apr-2010, 12:10 PM #6
Quote:
Originally Posted by andynic View Post
No it's not. I was misusing the button by giving each button a different name.
Better to use check boxes for multiple selections, not radio buttons.
Correct. You have to use a check box group for multiple selections, not a radio button group.

Peace...
Reply

Tags
html, radio buttons

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:13 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.