close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Need to add a star rating to website

Thread began 10/23/2019 12:06 pm by lr_leal239405 | Last modified 10/24/2019 12:41 pm by Ray Borduin | 32 views | 3 replies |

lr_leal239405

Need to add a star rating to website

Can you tell me if there's a Star Rating I can use built into your tools?

I saw a forum from Webassist with someone asking the same, but it's from 2009. Anything for 2019?

Appreciate your advise.

Sign in to reply to this post

Ray BorduinWebAssist

We don't have anything for that. It is essentially a custom form element that submits numbers 1-5 based on star clicks. We don't have anything like that, but a google search should turn something up you can use.

Sign in to reply to this post

lr_leal239405

I had downloaded a set of code to do just that before I contacted you and it had php issues. I then used the snippet of code you posted 10 yrs. ago, I used the hidden field to insert into the db, changed the one big star image to a 5 star image and just made sure the type in the table was set to decimal with 1 digit after decimal. It works great still:

Here's the code you had suggested if anyone cares to use it. It was simple and works for what I needed it - a simple form:

<script>
freeze = 0;
hasRated = false;
function point_it(event,freezeit){
pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("rating_image").offsetLeft;
pos_x = Math.round(pos_x/14)*14;
document.getElementById('rating_gradient').style.width = pos_x+"px";
if (freezeit) {
hasRated = true;
freeze = pos_x;
document.getElementById('hiddenRating').value = pos_x/28;
document.getElementById('RatingText').innerHTML = 'Current rating: <str' +'ong>'+(pos_x / 28)+'<\/strong>\/ 5';
}
}
function returntofreeze(){
document.getElementById('rating_gradient').style.width = freeze+"px";

}
</script>
How would you rate this?
<br />
<div id="rating_image" style="position:absolute"><img src="http://www.webassist.com/images/star_cutout.gif" width="140" height="28" alt="rating" onmousemove="point_it(event)" onclick="point_it(event,true)" onmouseout="returntofreeze()"/></div>
<div id="rating_gradient" style="width:0px;overflow:hidden;display:block;"><img src="http://www.webassist.com/images/star_gradient.jpg" width="140" height="28" /></div>
<input name="hiddenRating" type="hidden" id="hiddenRating" value="0" />
<div id="RatingText">Current rating: <strong>0</strong>/5</div>

Sign in to reply to this post

Ray BorduinWebAssist

This forum is a treasure trove ;)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...