donglipi4495 2013-08-06 16:24
浏览 57
已采纳

剩余的符号计数器与脚本

Here is what I used to make it:

$maxbodylength = 3500;
    $body = trim($_POST["body"]);
if (strlen($_POST['body']) > $maxbodylength)

   print("<tr><td style='padding: 0px'><textarea maxlength=$maxbodylength name=body id=body cols=100 rows=20 style='border: 0px'>" . htmlspecialchars($arr["body"]) . "</textarea>  </td></tr>
");

Currently I have managed to make posters to be allowed to type 3500 symbols. After making these 3500 they can no longer add more symbols to their post. How can I add a remaining symbols counter?

  • 写回答

1条回答 默认 最新

  • dtvpe4837413 2013-08-06 16:34
    关注

    A remaining characters counter is easily implemented with JavaScript, look here for an example, or Google search for a list of many more.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?