[CGI] Add character-counter for the reviews [DONE]

old granted and denied feature requests

Moderator: AniDB

Locked
wahaha
AniDB Staff
Posts: 1497
Joined: Sun Nov 17, 2002 3:33 pm

[CGI] Add character-counter for the reviews [DONE]

Post by wahaha »

This had been suggested already, and since JavaScript already slowly takes over the page, why not continue with a simple counter. ^^

A possible implementation for this would be to replace in the current version:

Code: Select all

<tr>
    <td colspan=2 align="center"> <input type="submit" name="add" value=" ADD "> </td>
</tr>
with this one: (tested in ie6 and mozilla 1.4)

Code: Select all

<tr>
  <td colspan=2>
    <table width="100%" border=0><tr>
      <td align="center">
        <script language="JavaScript1.2" type="text/javascript"><!--
          document.write('You wrote: <input type="text" size="4" name="charcounter" value="0" style="text-align: right" readonly> characters.<br>');
          function charcount(textarea) {
            textarea.form.charcounter.value = textarea.value.length;
            textarea.form.add.disabled = (textarea.value.length < 500) ? true : false;
          }
        --></script>
        Your review needs to be at least 500 chars long.
      </td>
      <td align="center"> <input type="submit" name="add" value=" ADD "> </td>
    </tr></table>
  </td>
</tr>
(and of course remove the character-count from the list of "basic rules")

It'd look like this, btw:
Image
(The "ADD"-button is disabled once the user clicks in the <textarea>)

Advantages:
+ Makes the minimum-length easier to, uh, obey (given the browser can handle javascript 1.2)
+ The "You wrote [0] characters"-part only shows when javascript is enabled, so there are no dead controls

Disadvantages:
- Needs 600 bytes :P
nwa
AniDB Staff
Posts: 585
Joined: Sat Jun 07, 2003 10:51 am

Post by nwa »

i support the idea..but what about the reviews that have already been posted and are below the character limit?
I take it that they remain for the voting?
(yes even I have a review which has less than 500 characters..I think)
Locked