How to control that when the input box exceeds a certain number of characters, you can't continue to enter it.

problem description

After the

input box exceeds a certain number of characters, you can"t continue typing. You can"t use maxlength, to ask for advice.

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Dec.24,2021

< input type= "text" maxlength= "10" placeholder= "can only enter 10 characters" / >


maxlength


the input box will trigger an event when the content changes, so that you can check the character length in the input box in real time and restrict input. Remember to consider compatibility. The reference link is as follows:
https://www.cnblogs.com/littl.


<input type="text" oninput="if(value.length>5)value=value.slice(0,5)" />
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b474-2b9fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b474-2b9fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?