当前位置:网站首页>Verify the word limit of textarea input box. Only prompt but no submission limit
Verify the word limit of textarea input box. Only prompt but no submission limit
2022-06-13 08:22:00 【SDL Dahua】
[ recommend ] Small program version system background rapid development Recommend a real-time news interface : Suitable for news APP、 Website 、 Small program etc.
// Original handwriting , Multiple tests are available , Welcome to discuss
// The code only depends on jQuery
<div class="formControls col-xs-8 col-sm-9">
<!-- Core code start-->
<textarea name="tablemsg" cols="" rows="" class="textarea" placeholder=" Say something ... Minimum input 10 Characters "
onKeyUp="Huitextarealength(this)"></textarea>
<p class="textarea-numberbar"><em class="textarea-length">0</em>/
<am>100</am>
</p>
<!-- Core code end-->
</div>
/**
* verification textarea Input box word limit , Prompt only, no submission restrictions
* 1、 The total must be used in <am> Label up 2、 Call this method
* Reference resources :<em class="textarea-length">0</em>/<am>100</am>
* @param obj
* @constructor
*/
var Huitextarealength = function (obj){
var html = $(obj).parent();
var tatal = html.find('am').html();
var sets = $(obj).val().length;
if(sets*1>tatal*1){
var str = '<div style="width: auto;position: absolute; right: 4%;color: red;"> Content exceeds limit </div>';
$(obj).after(str);
html.find('em').css({color:'red'});
}else {
$(obj).parent().find('div').remove();
html.find('em').css({color:'black'});
}
// Set the entered quantity
html.find('em').html(sets);
}
边栏推荐
- Set implements list search and exclusion
- 口碑好的食材配送信息化管理系统怎么样?
- Local shooting range 2- file upload vulnerability (III) - Network Security
- How about a well-known food material distribution information management system?
- ERP basic data concept
- File upload question type
- Introduction to dfinity (ICP) -1
- [game theory complete information static game] Application of Nash equilibrium
- JS to download files in batches
- 汽配行业面临的难题用什么软件帮忙解决呢
猜你喜欢
![[game theory complete information static game] Nash equilibrium](/img/db/9923f5a7465c8b57182f09810b65bf.jpg)
[game theory complete information static game] Nash equilibrium

ERP basic data Kingdee

MySQL installation and configuration under Windows

array_ Pop error: only variables should be passed by reference

Is there any good management software to solve the problems faced by tea wholesalers

Several precise order receiving methods suitable for fresh food wholesale industry

MySQL queries difference sets (missing data) by linking tables based on an associated field
Import the robot model built by SolidWorks into ROS

4. fabric2.2 create and join channels (use the official demo)

How to efficiently manage commodities and inventory in the beverage wholesale industry
随机推荐
Cosmos star application case
How to install the bdtab (BD) new tab plug-in in edge browser (Graphic tutorial)
Sizeof, strlen find character length
How to hide tabs in nailing applet
酒水批发行业应当如何高效管理商品与库存
System safety and Application
LeetCode-按奇偶排序数组
口碑好的食材配送信息化管理系统怎么样?
ES6 deleting an attribute of an object
有什么好的管理软件来解决茶叶批发商面临的难题
How to efficiently manage commodities and inventory in the beverage wholesale industry
Basic operation of dfinity (ICP) development-4
Overall process analysis of account book operation in fabric0.6
【博弈论-完全信息静态博弈】 Nash均衡的应用
Shellshock Attack Lab
Introduction to dfinity (ICP) -1
钉钉小程序如何隐藏tab
MySQL parsing serialized fields
BD新标签页(BdTab)插件如何登入?
Overview of cross chain protocol IBC