473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3400
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*************@TK2MSFTNGP10.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**************@TK2MSFTNGP12.phx.gbl>...
"Emmett Power" wrote in message news:u2*************@TK2MSFTNGP10.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.google.c om...
: "Roland Hall" <nobody@nowhere> wrote in message
news:<Or**************@TK2MSFTNGP12.phx.gbl>...
: > "Emmett Power" wrote in message
news:u2*************@TK2MSFTNGP10.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=VBScript %>
<% Option Explicit
' called from c:\exp.vbs
dim oArgs, i
oArgs = split(Request.QueryString("tasks"),", ")
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**************@TK2MSFTNGP09.phx.gbl>...
"Emmett Power" wrote in message
news:6e**************************@posting.google.c om...
: "Roland Hall" <nobody@nowhere> wrote in message
news:<Or**************@TK2MSFTNGP12.phx.gbl>...
: > "Emmett Power" wrote in message
news:u2*************@TK2MSFTNGP10.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=VBScript %>
<% Option Explicit
' called from c:\exp.vbs
dim oArgs, i
oArgs = split(Request.QueryString("tasks"),", ")
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
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...
4
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...
2
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...
1
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...
5
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...
5
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...
1
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...
5
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...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.