Jump to content

Moving from a radio to a images


Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/261876-moving-from-a-radio-to-a-images/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.