Forum Moderators: not2easy

Message Too Old, No Replies

Radio buttons won't group in CSS tooltip

They work fine outside the tool tip

         

SamF

4:41 pm on Mar 20, 2007 (gmt 0)

10+ Year Member



Hi all,

I've implemented the CSS options for my site in a standard "floating" CSS tooltip, where the CSS code is:

----
a.options {
position: relative;
}

a.options span {
display: none;
}

a.options:hover span {
display: block;
position: absolute;
z-index: 100;
}
----

When I try to put radio buttons in the tooltip, all the associated JavaScript works fine, but the buttons won't select and deselect as normal: rather, the first option selected will select, and nothing else in the group will show itself as selected after that. When I put them outside the tooltip, they work fine.

Can anyone work out what's going on?

----
<a href="#" onclick="return false;" class="options">Options<span>
<p>
Text size: <input name="textSize" type=radio onclick="ChangeFontSize('standard');"> Standard<input name="textSize" type=radio onclick="ChangeFontSize('largetext');"> Large
</p>
<p>
Contrast: <input name="contrast" type=radio onclick="ChangeContrast('standard');"> Standard<input name="contrast" type=radio onclick="ChangeContrast('highcontrast');"> High
</p>
</span></a>
----

Any help would be greatly apprectiated!
Thanks,
Sam

[edited by: SamF at 4:42 pm (utc) on Mar. 20, 2007]

Setek

1:06 am on Mar 21, 2007 (gmt 0)

10+ Year Member



You have block-level elements within your anchor :)

Validate the code - it will fail on that.

Your anchor is the wrapping element for the tooltip. It's saying "these are my contents, when you click on them, you're going to do what I've defined."

You'll have to recode your tooltip to not rely on making use of the

:hover
pseudoclass of anchors, and since IE 6 won't adhere to using that pseudoclass on any other element, you'll have to use
onmouseover
and
onmouseout
instead.

SamF

6:31 pm on Mar 21, 2007 (gmt 0)

10+ Year Member



Ok, thank you very much.

BTW, in case others are looking for this, I've found a nice tutorial on doing exactly what you said: <snip>

Thanks!
Sam

[edited by: Robin_reala at 10:40 pm (utc) on Mar. 22, 2007]
[edit reason] Removed URLs as per TOS #13 [webmasterworld.com] [/edit]

Setek

10:20 pm on Mar 21, 2007 (gmt 0)

10+ Year Member



Hi SamF,

Yeah, if you'll check out the Webmaster World Terms of Service [webmasterworld.com] and the CSS Forum's more specific Charter [webmasterworld.com] it will detail rules about posting URIs, style of questions, etcetera. Basically, you're not allowed to drop URIs :)

You are allowed some, like dropping a page on the W3C (I think the quid pro quo is nothing promotional, only reference material,) but often one finds it easier to just not drop any :)