HTML Form How to - Create rate form








Question

We would like to know how to create rate form.

Answer


<html>
<head>
<style>
fieldset {<!--from  ww  w. j ava 2 s.  c o m-->
  font-size: 12px;
  font-weight: bold;
  padding: 10px;
  width: 500px;
}

td {
  font-size: 12px;
  width: 80px;
  text-align: center;
}
</style>
</head>
<body>

  <form name="frmExample" action="" method="post">
    <fieldset>
      <legend>Rate this article:</legend>

      <table>
        <tr>
          <td><label for="VeryGood">Very good</label></td>
          <td></td>
          </td>
          <td><label for="Average">Average</label></td>
          <td></td>
          <td><label for="VeryPoor">Very poor</label></td>
        </tr>
        <tr>
          <td><input type="radio" name="radRating" value="5"
            id="VeryGood" /></td>
          <td><input type="radio" name="radRating" value="4" id="Good" /></td>
          <td><input type="radio" name="radRating" value="3"
            id="Average" /></td>
          <td><input type="radio" name="radRating" value="2" id="Poor" /></td>
          <td><input type="radio" name="radRating" value="1"
            id="VeryPoor" /></td>
        </tr>
      </table>

      <input type="submit" value="Vote now" />

    </fieldset>
  </form>

</body>
</html>

The code above is rendered as follows: