|
-
Oct 3rd, 2000, 08:08 AM
#1
Thread Starter
Addicted Member
Hi Y'all
I've never used radio buttons B4 (honest), but I'm using them on a page to select from various options. The problem I have is, all buttons can be selected simultaniously, and so could anyone tell me how to create an 'exclusive OR' situation - It dosn't cover this in my html book (In fact, the examples have the same problem as me.
Cheers 'n' Beers,
Skeen
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Oct 3rd, 2000, 10:22 AM
#2
Frenzied Member
I only used them for the first time last week!
They all need to have the same name (like an array).
Code:
<B>Select Beverage...</B><BR>
<INPUT id=16 type=radio name=radio1>16 Coffee white…<BR>
<INPUT id=27 type=radio name=radio1>27 Chocolate<BR>
<INPUT id=31 type=radio name=radio1>31 Coffee white with sugar<BR>
<INPUT id=39 type=radio name=radio1>39 Black no sugar<BR>
<INPUT id=41 type=radio name=radio1>41 Coffee white stuff<BR>
<INPUT id=63 type=radio name=radio1>63 Frothy Chocolate<BR>
<INPUT id=67 type=radio name=radio1>67 Stagnant Water<BR>
<INPUT id=843 type=radio name=radio1>843 Pete's wimpy drink<BR>
-
Oct 3rd, 2000, 11:52 AM
#3
Why do you use ID?
Maybe its something new in HTML 4, but when I learned HTML a year and a half ago, I was tought to do it this way..
Code:
<HTML>
<HEAD>
<TITLE>My Radio Button Example</TITLE>
</HEAD>
<BODY>
<FORM ACTION="MAILTO:[email protected]" METHOD="POST">
<INPUT TYPE="RADIO" NAME="Age" VALUE="13">13 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="14">14 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="15">15 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="16">16 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="17">17 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="18">18 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="19">19 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="20">20 <BR>
<INPUT TYPE="RADIO" NAME="Age" VALUE="21">21 <BR>
</FORM>
</BODY>
</HTML>
I use the VALUE Property thing instead of ID...
I am sure your way works fine.. but I always read books and tutorials that said to do it this way.
-
Oct 3rd, 2000, 12:45 PM
#4
Thread Starter
Addicted Member
Cheers
I get it now - count and loop through the buttons - returning th value.
Nice1 - works a treat!
have a stella on me!
Skeen
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Oct 4th, 2000, 02:15 AM
#5
Frenzied Member
denniswrenn
No reason in particular!
that piece of code was taken from something I wrote to amuse my colleagues. ID worked (on IE5)so I left it at that.
Our company has a web based system called "Kappa" so I knocked-up a parody if it for ordering coffee and called it Kuppa 
-
Oct 4th, 2000, 10:08 AM
#6
I am not absolutely sure, but I think that VALUE would be more compatible with older browsers only being able to read HTML3.... 
But I don't have any older browsers... so I can't test it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|