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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.