473,602 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple values for radio buttons

Hi,

I have a form on a web page with a number of radio buttons bound to
the same field. Is it possible to set up the form so that users can
select more than one radio button to submit multiple values to a field
in the way that you can, for example, in a drop down field?

Thanks in advance for any suggestions.

With regards
Emmett Power
Jul 19 '05 #1
6 3426
Em****@Silico-Research.com (Emmett Power) wrote:
Hi,

I have a form on a web page with a number of radio buttons bound to
the same field. Is it possible to set up the form so that users can
select more than one radio button to submit multiple values to a field
in the way that you can, for example, in a drop down field?


Nope, that's not the way radio buttons work. It sounds like you're
looking for checkboxes, they would behave the closer to the way you
want. The user could select any combination of the checkboxes, the web
app would receive an "x=y" for each box selected.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls. gov
Jul 19 '05 #2
Thanks Tim,

I guess if I give the checkboxes the same name but different values I'll
achieve what I'm looking for.

Regards

Emmett Power

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
"Emmett Power" wrote in message news:u2******** *****@TK2MSFTNG P10.phx.gbl...
: I guess if I give the checkboxes the same name but different values I'll
: achieve what I'm looking for.

There is no ASP script in these but this examples show how to use checkboxes
and multiple selects. Other than scripting language and related, they are
exactly the same:

VBScript version:
http://kiddanger.com/lab/exp.asp

J(ava)Script version:
http://kiddanger.com/lab/expjs.asp

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #4
"Roland Hall" <nobody@nowhere > wrote in message news:<Or******* *******@TK2MSFT NGP12.phx.gbl>. ..
"Emmett Power" wrote in message news:u2******** *****@TK2MSFTNG P10.phx.gbl...
: I guess if I give the checkboxes the same name but different values I'll
: achieve what I'm looking for.

There is no ASP script in these but this examples show how to use checkboxes
and multiple selects. Other than scripting language and related, they are
exactly the same:

VBScript version:
http://kiddanger.com/lab/exp.asp

J(ava)Script version:
http://kiddanger.com/lab/expjs.asp

HTH...


Roland,

Thanks for the code. It is very helpful.

Regards

Emmett
Jul 19 '05 #5
"Emmett Power" wrote in message
news:6e******** *************** ***@posting.goo gle.com...
: "Roland Hall" <nobody@nowhere > wrote in message
news:<Or******* *******@TK2MSFT NGP12.phx.gbl>. ..
: > "Emmett Power" wrote in message
news:u2******** *****@TK2MSFTNG P10.phx.gbl...
: > : I guess if I give the checkboxes the same name but different values
I'll
: > : achieve what I'm looking for.
: >
: > There is no ASP script in these but this examples show how to use
checkboxes
: > and multiple selects. Other than scripting language and related, they
are
: > exactly the same:
: >
: > VBScript version:
: > http://kiddanger.com/lab/exp.asp
: >
: > J(ava)Script version:
: > http://kiddanger.com/lab/expjs.asp
: >
: > HTH...
:
: Roland,
:
: Thanks for the code. It is very helpful.

Hi Emmett...

You're welcome. BTW... Here is the code for exp2.asp that both of the files
call.

<%@ Language=VBScri pt %>
<% Option Explicit
' called from c:\exp.vbs
dim oArgs, i
oArgs = split(Request.Q ueryString("tas ks"),", ")
for i = 0 to ubound(oArgs)
Response.Write( oArgs(i) & "<br />" & vbCrLf)
next
%>

This, if you're not familiar, shows you how to pass and parse a multi-value
variable rather than with a form that passes one value per variable. Ignore
the comment for called from c:\exp.vbs. This file was first used as a post
target from a local WSH file.

It started here:
http://groups.google.com/groups?q=ro...phx.gbl&rnum=2

This started with code from someone else.

Converted from WSH to VBScript/J(ava)Script for the web here:
http://groups.google.com/groups?q=ro...phx.gbl&rnum=1

....which has some other interesting examples of using checkboxes although
granted checkboxes are not the best solution in these examples. It was more
due to the topic of discussion.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but w
ithout any warranty; without even the implied warranty of merchantability or
fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #6
"Roland Hall" <nobody@nowhere > wrote in message news:<eh******* *******@TK2MSFT NGP09.phx.gbl>. ..
"Emmett Power" wrote in message
news:6e******** *************** ***@posting.goo gle.com...
: "Roland Hall" <nobody@nowhere > wrote in message
news:<Or******* *******@TK2MSFT NGP12.phx.gbl>. ..
: > "Emmett Power" wrote in message
news:u2******** *****@TK2MSFTNG P10.phx.gbl...
: > : I guess if I give the checkboxes the same name but different values
I'll
: > : achieve what I'm looking for.
: >
: > There is no ASP script in these but this examples show how to use
checkboxes
: > and multiple selects. Other than scripting language and related, they
are
: > exactly the same:
: >
: > VBScript version:
: > http://kiddanger.com/lab/exp.asp
: >
: > J(ava)Script version:
: > http://kiddanger.com/lab/expjs.asp
: >
: > HTH...
:
: Roland,
:
: Thanks for the code. It is very helpful.

Hi Emmett...

You're welcome. BTW... Here is the code for exp2.asp that both of the files
call.

<%@ Language=VBScri pt %>
<% Option Explicit
' called from c:\exp.vbs
dim oArgs, i
oArgs = split(Request.Q ueryString("tas ks"),", ")
for i = 0 to ubound(oArgs)
Response.Write( oArgs(i) & "<br />" & vbCrLf)
next
%>

This, if you're not familiar, shows you how to pass and parse a multi-value
variable rather than with a form that passes one value per variable. Ignore
the comment for called from c:\exp.vbs. This file was first used as a post
target from a local WSH file.

It started here:
http://groups.google.com/groups?q=ro...phx.gbl&rnum=2

This started with code from someone else.

Converted from WSH to VBScript/J(ava)Script for the web here:
http://groups.google.com/groups?q=ro...phx.gbl&rnum=1

...which has some other interesting examples of using checkboxes although
granted checkboxes are not the best solution in these examples. It was more
due to the topic of discussion.

Thanks for the help Roland.

Regards

Emmett
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2292
by: elhombrebala | last post by:
With this script I can force the user to select the checkbox befor continuing, but now I have a menu with lots of radio unputs and I woul like the user to select at least 2 of them; how can I check it? <form name=formulario> <INPUT type=checkbox name=casilla> <INPUT type=button value="Salir" onclick="Goingout()"> </form>
4
3808
by: Dave Parrin-Bull | last post by:
Hi all, I have been asked (nay told!) to do a quiz for a webpage at work, now I can do the basic things like getting the radio boxes up there and assign values to them but here is what they want: 5 options (done that) You can only select 2 of the 5 options (dont know how to do that)
2
3135
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as they want. If they need to add more, they click an "add name" button and the javascript inserts another row of input boxes. Each row should have two radio buttons to indicate sex (M F). When you have multiple text input boxes with the same...
1
2725
by: Bill_W_Stephens | last post by:
I have a complicated page with several submit buttons. I don't want to create multiple forms because much of the input is shared and the code is getting very ugly. However I would like to determine which values will be submited. Here is a simplified example that may better illustrate my question. Or maybe there is a better approach... <SCRIPT language="JavaScript">
5
2447
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has made the postback request.???" for e.g. I have a webpage default.aspx. I place TWO or more server buttons on it. Create server-side event handlers for each of the buttons.
5
2140
by: Mirovk | last post by:
The onclick action associated to my form´s radio buttons call to a vbscript were the session values are changed, this happens correctly but with the onclick action associated to my continue button always shows the value =1 instead the values selected under my radio buttons (Values= 4,3 or 1) I am showing the code. Ideas welcome.
1
1841
by: Renjini Mary | last post by:
hi... i cant seem to get value of set of radio buttons thru javscripting.. i hv set values to the radiobuttons but cannot retrieve them or calculate them in JS although it looks simple. do i need to convert the values to numeric in JS.. pls help me I am stuck..i hv pasted the code below: ******************************** <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId"...
5
7432
stepterr
by: stepterr | last post by:
I have a form that is built based on a query. Everything is working except when I submit the form the radio buttons are only updating the first row in my database. dcategory and dthumbnail are two radio buttons that I have for each one of the rows in the table. I've tried using a hidden input object for each of the radio button groups to store the values in but clearly I'm having a mental block because I can't get that to work right either. So...
4
5688
by: CURTISLESPERANCE | last post by:
Hi, I am trying to figure out if this is possible. I need to display 4 radio buttons next to a question then 3 radio buttons after. The 2 different group radio buttons and questions are coming from a database. I have the questions being displayed right now using a repeater control but I am having an issue making 4 and 3 radio buttins per question for multiple questions. However some questions have sub questions so the parent question...
0
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8404
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8268
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.