Home > Web Front-end > JS Tutorial > Inputlimiter based on jquery implements word limit function_jquery

Inputlimiter based on jquery implements word limit function_jquery

WBOY
Release: 2016-05-16 18:26:06
Original
1333 people have browsed it

看下效果图:
Inputlimiter based on jquery implements word limit function_jquery
源代码:

复制代码 代码如下:





Input Limiter Demo







字数限制功能列子




字数限制
标题:

自定义字段1:

自定义字段2:










这里的限制字数是动态设置的,所以配置了一个ASP页面和一个XML文件

ASP
复制代码 代码如下:

<%
num = Trim(Request("Num")) 'Word limit value
channelid = Trim(Request("ChannelID")) 'Channel ID
sfield = Trim (Request("Field")) 'Field with character limit value that needs to be set

set objDom = server.CreateObject("MicroSoft.XMLDom")
objDom.load(Server.MapPath("test .xml"))
Set objNode = objDom.documentElement
'Node length
newint=objNode.ChildNodes.length-1
for i=0 To newint
'Node id attribute
set objarr=objNode.ChildNodes.item(i)
if ( objarr.Attributes.item(1).Text = channelid) then
if( objarr.ChildNodes.item(0).Attributes.item(1 ).Text = sfield ) then
'Directly locate the content of the attribute under the node ID
objDom.getElementsByTagName("channel").item(i).childNodes.item(0).Attributes.item(2 ).Text = num
exit for
end if
end if
set objarr = Nothing
next
objDom.save(Server.MapPath("test.xml"))
set objNode = Nothing
Set objDom = Nothing
%>


XML
Copy code The code is as follows:




< /channel>
















Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template