freemancomputer Posted May 1, 2012 Share Posted May 1, 2012 I have a form on my web site for rating movies that uses radios. I would like to move away from that to a line of images where a user can click on there rating depending on which number down the line they click. I'm not sure if this should be done making the image into a submit or just a link. Here is what I have right now with the radios that works, this does feed into jquery so the user dosent have to leave the page. Any pointers and opinions are welcome. Thank you. <form id="add-rating"> <input type="radio" name="MOVIE_RATING" value="1" > 1 <input type="radio" name="MOVIE_RATING" value="2" > 2 <input type="radio" name="MOVIE_RATING" value="3" checked="yes"> 3 <input type="radio" name="MOVIE_RATING" value="4" > 4 <input type="radio" name="MOVIE_RATING" value="5" > 5 <br> <input type="hidden" name="MOVIE_ID" value="<?php echo $id; ?>"> <input type="hidden" name="MOVIE_TITLE" value="<?php echo stripslashes($title); ?>"> <input type="hidden" name="USER_ID" value="<?php echo $loggedinusername; ?>"> <input type="submit" value="Rate"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/261876-moving-from-a-radio-to-a-images/ Share on other sites More sharing options...
marcus Posted May 1, 2012 Share Posted May 1, 2012 This isn't really a relevant PHP question, more-so JavaScript. I made a mock-up of an idea you might want: http://jsfiddle.net/DLVzN/ If you click on a number it highlights all the numbers less than or equal to it, else it keeps it blank. So you could add more attributes to the span if you wanted to include the movie ID and use var rating as the rating. Quote Link to comment https://forums.phpfreaks.com/topic/261876-moving-from-a-radio-to-a-images/#findComment-1341841 Share on other sites More sharing options...
freemancomputer Posted May 1, 2012 Author Share Posted May 1, 2012 That's kind of what I thought, didn't know if there was a way php could handle it. Ill take a look at the example. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/261876-moving-from-a-radio-to-a-images/#findComment-1341842 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.