Forgot password
 Register account
View 219|Reply 2

标题长度限制

[Copy link]

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2022-9-29 02:29 |Read mode
建议:有字数限制的<input>加上maxlength属性
比如:标题字数限制80
  1. <input type="text" name="subject" id="subject" class="px" value="..." onkeyup="strLenCalc(this, 'checklen', 80);" style="width: 25em" tabindex="1">
Copy the Code
可以加上<input maxlength="80">

3200

Threads

7827

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 2022-9-29 02:31
hbghlyj 发表于 2022-9-28 19:29
建议:有字数限制的加上maxlength属性
比如:标题字数限制80

这个onkeyup只是当输入时更新字数.
如果是鼠标右键粘贴文字,就没有更新字数.

3200

Threads

7827

Posts

52

Reputation

Show all posts

original poster hbghlyj posted 2023-1-14 07:11

标题长度的计算 前端、后端不兼容

abababa 发表于 2014-6-25 01:11
还有我发帖时说标题长度多于80字,是不是能放宽点呢?有时打上一些latex就很长了
hbghlyj 发表于 2022-12-23 15:20
431 优化 支持论坛、门户、日志标题长度自定义,放宽标题最长 80 个字节的限制到 255 字
  1. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Copy the Code
前端计算的长度为80, 后端计算的长度也为80, 可以用80个a为标题发帖.
  1. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Copy the Code
前端计算的长度为80, 不可用80个<为标题发帖(提示: 抱歉,您的标题超过 80 个字符修改标题长度), 由此推断, 后端计算的长度大于80 (具体多少未知).

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-15 13:54 GMT+8

Powered by Discuz!

Processed in 0.021505 seconds, 22 queries