Forum Moderators: not2easy

Message Too Old, No Replies

styling radio buttons

         

Skier88

3:15 pm on May 21, 2010 (gmt 0)

10+ Year Member



I am trying to make a rating system with score selection done by clicking on a star, 1 through 5. However, I also want to keep it js free. What I have pretty much works, but it uses links. While that is useful to take the user to a review composition page, I also want the user to be able to change the rating while on that page without refreshing.

To me that says radio buttons, but I have been unable to apply the same styles to them. Any way I can get the rating value in $_POST without using javascript is fine with me. Any suggestions?

Here's what I have right now.
CSS

.rating {margin:0; position:relative; display:block; width:150px; height:30px;}
.rating, .rating a:hover, .current {background:url('/_structure/star.gif');}
.rating li {display:inline;}
.rating a, .current {height:100%; position:absolute;}
.rating a:hover {background-position:left center;}
.current {background-position:left bottom;}

HTML

<ul class='rating' style='margin:0 auto;'>
<li class='current' style='width:100%;'></li>
<li><a href='?mode=rate&rating=5' style='width:100%;'></a></li>
<li><a href='?mode=rate&rating=4' style='width:80%;'></a></li>
<li><a href='?mode=rate&rating=3' style='width:60%;'></a></li>
<li><a href='?mode=rate&rating=2' style='width:40%;'></a></li>
<li><a href='?mode=rate&rating=1' style='width:20%;'></a></li>
</ul>


Thanks for reading.

alt131

2:00 am on May 22, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi skier88,
Are you asking how to target "select" the radio buttons to apply a style, or are you asking what styles can be applied to radio buttons?

Skier88

10:59 pm on May 25, 2010 (gmt 0)

10+ Year Member



Hi alt131, thanks for the reply. Actually I've researched both of those, and it seems that you can't apply enough styles to radio buttons for what I'm trying to do. So basically what I'm asking is for some way this problem can be solved, since what I've tried doesn't work.

alt131

11:37 pm on May 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



and it seems that you can't apply enough styles to radio buttons for what I'm trying to do.
Thanks for the clarification - that was my first thought when reading your post.

However, am still not sure of the actual "problem". The opening description is really a proramming issue, and perhaps better asked in php or javascript. I know you don't want javascript, but they may be able to suggest other options.

If it's style, then maybe scribe up some example buttons and identify what you are trying to do. Sometimes styles can be applied (while retaining usabilty) in ways that aren't immediately obvious.