Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem: Multiple multiple radio buttons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem: Multiple multiple radio buttons

 Post Reply Post Reply Page  12>
Author
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post Topic: Problem: Multiple multiple radio buttons
    Posted: 29 October 2003 at 6:47am
I'm trying to do a form where each item in a list is displayed and given an "accept", "decline" or "ignore" option.

I can do this with check boxes, where the box names are (eg) ChkAccept, ChkDecline, ChkIgnore and have values set by the list item ID number; the processing file then does (in the case of acceptances):

For each laryAcceptID in Request.Form("ChkAccept")

'Then goes through DB where item ID = laryAcceptID;
'Ammend record as appropriate to note acceptance

Next

'Similar loop then processes the Declines, for Request.Form("ChkDecline")


However, that doesn't stop people ticking more than one box for each item, which obviously causes the system to throw a wobbly.

I'd like to therefore use radio buttons, but for each item I believe I'm right in thinking all three need the same name (in order to group correctly). This means I can't see a way of processing the information similar to the above.

Any suggestions gratefully received!

www.pedalcars.info

The most fun on four wheels

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2003 at 8:07am

so you have:

Accept:
- checkbox1
- checkbox2
- checkbox3

Decline:
- checkbox4
- checkbox5
- checkbox6

and you don't want someone to be able to select from both sets of boxes?

answer that and i'll whip up some Javascript to handle that.. radio boxes are NOT going to work in this case because you can only select one, and you said above that people can select multiple in a group, so that rules out radios...

man, let me tell you, between this thread and others by you in the past, you write some whacked/confusing pages for your clients/members

Contribute to the working anarchy we fondly call the Internet
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2003 at 8:20am
What you should do is:

Line 1 o Accept o Decline o Ignore
Line 2 o Accept o Decline o Ignore
Line 3 o Accept o Decline o Ignore
Line 4 o Accept o Decline o Ignore
Line 5 o Accept o Decline o Ignore

The radio button in each line should have the same name, but different values. So let's say you have
Line 1
<input name=1 value=1 type=radio>Accept
<input name=1 value=-1 type=radio>Decline
<input name=1 value=0 type=radio>Ignore

Line 2
<input name=2 value=1 type=radio>Accept
<input name=2 value=-1 type=radio>Decline
<input name=2 value=0 type=radio>Ignore

etc...
Then you can do:
For i =1 to Request.Form.Count
if IsNumeric(Request.Form.Key(i)) then
    if Request.Form(i)=1 then
        ... Accept ....
    elseif Request.Form(i)=-1 then
        ... Decline ....
    else
        ... Ignore ...
    end if
end if
Next


Note this assumes your input names are numeric. If not then remove the IsNumeric check. I would use numeric values simply because it makes it easier to ignore other posted variables.


Edited by ljamal
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2003 at 9:05am
Contribute to the working anarchy we fondly call the Internet
Back to Top
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 3:45am
Ljamal, thanks, I'll give it a go.

MorningZ, everything's for a purpose.

As it happens, this time you've got the wrong end of the stick. Maybe I wasn't clear enough:

I don't want anyone to check more than one box per item

So, you'd have:

| Item 1: O (accept) | O (decline) | O (ignore) |

If there was more than one item, there'd be more than one line. Then for each item you could select one box, so you could for example accept items 1, 3 and 5, decline items 2 and 6, and ignore item 4.

Does that make more sense?
www.pedalcars.info

The most fun on four wheels

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 8:05am

even better!!

less code

you obviously would have to physically move the checkboxes



Edited by MorningZ
Contribute to the working anarchy we fondly call the Internet
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 8:38am
Originally posted by MorningZ MorningZ wrote:

even better!!


less code


you obviously would have to physically move the checkboxes



Great! You've re-created the radio button.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2003 at 8:40am

i personally despise/hate the radio button...

but hey, sorry you think i wasted my time.. i'll do all the practice with Javascript i can get.....

Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.