php - Star Rating Form - Email Rating -
i have form has star rating system. users vote 1 through 5 stars. works great on front-end, when it's emailed through comes through this:
'rating-input-1: on'
i want give me number scored (1 - 5) rather 'on'. ideas? html , css code below, please let me know if need else.
html:
<span class="rating"> <input type="radio" class="rating-input" id="rating-input-1-1" name="rating-input-1"> <label for="rating-input-1-1" class="rating-star"></label> <input type="radio" class="rating-input" id="rating-input-1-2" name="rating-input-1"> <label for="rating-input-1-2" class="rating-star"></label> <input type="radio" class="rating-input" id="rating-input-1-3" name="rating-input-1"> <label for="rating-input-1-3" class="rating-star"></label> <input type="radio" class="rating-input" id="rating-input-1-4" name="rating-input-1"> <label for="rating-input-1-4" class="rating-star"></label> <input type="radio" class="rating-input" id="rating-input-1-5" name="rating-input-1"> <label for="rating-input-1-5" class="rating-star"></label> </span>
css:
.rating { overflow: hidden; } .rating-input { position: absolute; left: 0; top: -50px; } .rating:hover .rating-star:hover, .rating:hover .rating-star:hover ~ .rating-star, .rating-input:checked ~ .rating-star { background-position: 0 0; } .rating-star, .rating:hover .rating-star { float: right; display: block; width: 30px; height: 30px; background: url(images/stars2-2.png) 0 -30px; } .rating-star:hover { -webkit-transition: -webkit-width 0.5s; -moz-transition: -moz-width 0.5s; -ms-transition: -ms-width 0.5s; -o-transition: -o-width 0.5s; transition: width 0.5s; }
maybe can try add 'value' attribute every input. this:
<input type="radio" class="rating-input" id="rating-input-1-1" name="rating-input-1" value="1"> <input type="radio" class="rating-input" id="rating-input-1-2" name="rating-input-1" value="2">
Comments
Post a Comment