Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: RE: How do I request a group of radio button


Message #1 by "Drew, Ron" <RDrew@B...> on Thu, 13 Jun 2002 17:28:30 -0400
I use this for checkboxes, so it should work the same for radio.  If the
checkboxes or radio buttons have the same name on the form, when you
post the form the next asp can create an array and you just test it if
checkboxes and will have a number if radio button.  Example...
Checkboxes     name =3D chkbox, you check box 1 and 3 and 4 ..strbuttons
below will have a value of "1, 3, 4"
Radiobuttons     name =3D radiobox, you click box 3  ..strbuttons below
will have a value "3"

strbuttons =3D Request.Form("buttons")
Response.write strbuttons

If I am not correct, please let me know...as said I have used this for
checkboxes but have not tried with radio buttons.

-----Original Message-----
From: Anthony Delcy [mailto:DELCYAN@w...]
Sent: Thursday, June 13, 2002 5:07 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How do I request a group of radio button


Thank you but I need to do this on the server side not the client. In
asp, how do I do this?

Thank you

Anthony

>>> RDrew@B... 06/13/02 03:08PM >>>
Find out which RADIO button was pressed I use this Javascript...temphelp
is form...needs is name of radio buttons in group.  Just change stat =3D
true and replace with message indicating i was selected.

  var stat =3D false;
	for (var i =3D 0; i < document.temphelp.needs.length; i++) {
		if (document.temphelp.needs[i].checked)
		{
			stat =3D true;
		}
	}
	if (stat=3D=3Dfalse){
		alert("Please select a Needs.");
		document.temphelp.needs[0].focus();
		return (false);
	}

-----Original Message-----
From: delcyan@w... [mailto:delcyan@w...]
Sent: Thursday, June 13, 2002 12:26 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How do I request a group of radio button


Hello all,

I am doing a survey and there are 5 groups of radio button and 4 radio
button per group.

On the server, I want to loop through the first group of radio button
and
see which one in that group was selected.

My code below is not working. Please help me identifying my problem.

Thank you

Example 1
for intCount =3D 0 to 3
    if Request.Form("hd1(intcount)).checked") =3D true then
	intQ1 =3D 1
	intA1 =3D intcount+1		=09
    end if
next

Example 2
for intCount =3D 0 to 3
    if Request.Form("hd2(" & intcount & ").checked") =3D true then
	intQ2 =3D 2
	intA2 =3D intcount+1		=09
    end if
next

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e

r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e

r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #2 by "Anthony Delcy" <DELCYAN@w...> on Thu, 13 Jun 2002 17:06:46 -0400
Thank you but I need to do this on the server side not the client.
In asp, how do I do this?

Thank you

Anthony

>>> RDrew@B... 06/13/02 03:08PM >>>
Find out which RADIO button was pressed I use this Javascript...temphelp
is form...needs is name of radio buttons in group.  Just change stat =3D
true and replace with message indicating i was selected.

  var stat =3D false;
	for (var i =3D 0; i < document.temphelp.needs.length; i++) {
		if (document.temphelp.needs[i].checked)
		{
			stat =3D true;
		}
	}
	if (stat=3D=3Dfalse){
		alert("Please select a Needs.");
		document.temphelp.needs[0].focus();
		return (false);
	}

-----Original Message-----
From: delcyan@w... [mailto:delcyan@w...]
Sent: Thursday, June 13, 2002 12:26 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How do I request a group of radio button


Hello all,

I am doing a survey and there are 5 groups of radio button and 4 radio
button per group.

On the server, I want to loop through the first group of radio button
and
see which one in that group was selected.

My code below is not working. Please help me identifying my problem.

Thank you

Example 1
for intCount =3D 0 to 3
    if Request.Form("hd1(intcount)).checked") =3D true then
	intQ1 =3D 1
	intA1 =3D intcount+1		=09
    end if
next

Example 2
for intCount =3D 0 to 3
    if Request.Form("hd2(" & intcount & ").checked") =3D true then
	intQ2 =3D 2
	intA2 =3D intcount+1		=09
    end if
next

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramme

r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramme

r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramme

r-20
to unsubscribe send a blank email to leave-asp_web_howto-1124334F@p...
com.

Message #3 by "Drew, Ron" <RDrew@B...> on Thu, 13 Jun 2002 15:08:55 -0400
Find out which RADIO button was pressed I use this Javascript...temphelp
is form...needs is name of radio buttons in group.  Just change stat =3D
true and replace with message indicating i was selected.

  var stat =3D false;
	for (var i =3D 0; i < document.temphelp.needs.length; i++) {
		if (document.temphelp.needs[i].checked)
		{
			stat =3D true;
		}
	}
	if (stat=3D=3Dfalse){
		alert("Please select a Needs.");
		document.temphelp.needs[0].focus();
		return (false);
	}

-----Original Message-----
From: delcyan@w... [mailto:delcyan@w...]
Sent: Thursday, June 13, 2002 12:26 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How do I request a group of radio button


Hello all,

I am doing a survey and there are 5 groups of radio button and 4 radio
button per group.

On the server, I want to loop through the first group of radio button
and
see which one in that group was selected.

My code below is not working. Please help me identifying my problem.

Thank you

Example 1
for intCount =3D 0 to 3
    if Request.Form("hd1(intcount)).checked") =3D true then
	intQ1 =3D 1
	intA1 =3D intcount+1		=09
    end if
next

Example 2
for intCount =3D 0 to 3
    if Request.Form("hd2(" & intcount & ").checked") =3D true then
	intQ2 =3D 2
	intA2 =3D intcount+1		=09
    end if
next

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #4 by delcyan@w... on Thu, 13 Jun 2002 16:25:52
Hello all,

I am doing a survey and there are 5 groups of radio button and 4 radio 
button per group.

On the server, I want to loop through the first group of radio button and 
see which one in that group was selected.

My code below is not working. Please help me identifying my problem.

Thank you

Example 1
for intCount = 0 to 3
    if Request.Form("hd1(intcount)).checked") = true then
	intQ1 = 1
	intA1 = intcount+1			
    end if
next

Example 2
for intCount = 0 to 3
    if Request.Form("hd2(" & intcount & ").checked") = true then
	intQ2 = 2
	intA2 = intcount+1			
    end if
next

  Return to Index