Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

how to display a value in a progress bar

I am looking for a java control that can visually display a value from 0 to 100.  This is for display a student test score.  So if they log in, they will be able to see their score visually (like a bar from 1 to 100) and the score will be place in the bar according to the score
2 Solutions
Simplest way is to generate this on CF side.  Something like this:

<cfset score="80">

<cfoutput>Score: #score#</cfoutput>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr height="10">
<cfloop index="i" from="1" to="100">
   <cfif i LTE score>
      <td width="2" bgcolor="#FF0000">
      <td width="2" bgcolor="#FFFFFF">
<table width="202" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="000000">
<td background="images/score.gif" align="right" height="11"><img id="score1" src="Images/scoreover.gif" width="" height="15"></td>
<script language="JavaScript">
document.getElementById('score1').style.width = '73%';

Give that a try. I think that should work. And it's in Javascript...

-- Ian

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now