|
|
|
|
Thread title: Custom radio buttons. |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
06-15-2005, 02:20 PM
|
#1
|
Status: I love this place
Join date: Apr 2005
Location: Canada
Expertise:
Software:
Posts: 723
|
Custom radio buttons.
I have seen a few sites with custom radio buttons, such as:
http://www.ala.ch (at the top)
http://www.k10k.net (friggin everywhere)
Does anyone know how to do this? I checked around the sources and just get lost.
Thanks.
|
|
06-15-2005, 04:51 PM
|
#2
|
Status: Lurker
Join date: Jun 2005
Location:
Expertise:
Software:
Posts: 1,473
|
|
|
06-15-2005, 04:58 PM
|
#3
|
Status: I love this place
Join date: Apr 2005
Location: Canada
Expertise:
Software:
Posts: 723
|
uh, duh? (maybe I should have reworded the first post)... so do you know to make it switch images when clicked and then be able to send the information?
|
|
06-16-2005, 05:30 AM
|
#4
|
Status: Junior Member
Join date: Dec 2004
Location: Melbourne, AU
Expertise:
Software:
Posts: 33
|
Probably both would be handled by Javascript. When the image is clicked, a simple image change script makes the radio button look "clicked", and another script passes information to the server that says "this radio button was selected".
Specifically I couldn't tell you, but I'd wager it uses JScript.
|
|
06-16-2005, 06:06 AM
|
#5
|
Status: Request a custom title
Join date: Aug 2004
Location: California
Expertise:
Software:
Posts: 1,004
|
It's all CSS, I believe. Do a quick search for it on Google and you'll get some results.
|
|
06-16-2005, 09:43 AM
|
#6
|
Status: Junior Member
Join date: Dec 2004
Location: Melbourne, AU
Expertise:
Software:
Posts: 33
|
It's not CSS. CSS can't handle passing a variable anywhere.
|
|
06-16-2005, 09:44 AM
|
#7
|
Status: Junior Member
Join date: Dec 2004
Location: Melbourne, AU
Expertise:
Software:
Posts: 33
|
These are the on/off radio buttons from the ala.ch site:
Code:
<td width="36" height="28" align="left" valign="middle"><a href="javascript:action='add'; changeImage(null,'radiobut_add','chckbox_true'); changeImage(null,'radiobut_remove','chckbox_false');" onMouseover="window.status='subscribe'; return true;" onMouseover="window.status=''; return true;" onClick="window.status=''; return true;" onFocus="blur();"><img src="../media/img/header/chckbox_true.gif" name="radiobut_add" alt="" width="11" height="12" border="0"><img src="../media/img/header/b10.gif" alt="" width="18" height="12" border="0"></a></td>
<td width="36" height="28" align="left" valign="middle"><a href="javascript:action='remove'; changeImage(null,'radiobut_add','chckbox_false'); changeImage(null,'radiobut_remove','chckbox_true');" onMouseover="window.status='unsubscribe'; return true;" onMouseover="window.status=''; return true;" onClick="window.status=''; return true;" onFocus="blur();"><img src="../media/img/header/chckbox_false.gif" name="radiobut_remove" alt="" width="11" height="12" border="0"><img src="../media/img/header/b11.gif" alt="" width="24" height="12" border="0"></a></td>
That javascript would do it all. Have a poke around and you should be able to find the functions that actually do the work.
|
|
06-16-2005, 09:45 AM
|
#8
|
Status: Request a custom title
Join date: Aug 2004
Location: California
Expertise:
Software:
Posts: 1,004
|
Originally Posted by plattopus
It's not CSS. CSS can't handle passing a variable anywhere.
|
Oh nvm, I thought he was talking about the styling
|
|
06-20-2005, 05:42 AM
|
#9
|
Status: I'm new around here
Join date: Jun 2005
Location: Fort Wayne, Indiana, USA
Expertise:
Software:
Posts: 10
|
Could you do it the same way you change the submit button?
|
|
06-20-2005, 09:41 AM
|
#10
|
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
Posts: 3,820
|
It's possible with good old JavaScript (making use of the DOM) to only markup the regular checkbox (for people without JS enabled) and dynamically change that to a working on/off image.
Joey D, no you can't do it that way.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|