Multiple values for radio buttons

E

Emmett Power

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
 
T

Tim Slattery

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.
 
E

Emmett Power

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
 
R

Roland Hall

in message : 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
 
E

Emmett Power

Roland Hall said:
in message : 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
 
R

Roland Hall

in message
: > "Emmett Power" wrote in message
: > : 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/[email protected]&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=r...=#[email protected]&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
 
E

Emmett Power

Roland Hall said:
in message
: > "Emmett Power" wrote in message
: > : 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/[email protected]&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=r...=#[email protected]&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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top