var html = '<fieldset class="struct-info" id="SlopeZY"><legend>变坡点(ZY)</legend>';
html += '<input type="hidden" id="SlopeZYId" name="SlopeZYId"/>';
if (me.Paras.IsUseCircle != undefined && me.Paras.IsUseCircle == 'True') {
html += '<div class="row"><label for="SlopeZYStartCircle">开始环号:</label><input id="SlopeZYStartCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999" /></div>';
html += '<div class="row"><label for="SlopeZYEndCircle">结束环号:</label><input id="SlopeZYEndCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
}
html += '<div class="row"><label for="SlopeZYStartMileage">开始里程:</label>' + me.Paras.prefix +'<input id="SlopeZYStartMileage1" type="text" class="easyui-validatebox" data-options = "validType:&apos;numberWithZero&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeZYStartMileage2" type="text" class="easyui-validatebox" data-options = "validType:&apos;double&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
html += '<div class="row"><label for="SlopeZYEndMileage">结束里程:</label>' + me.Paras.prefix +'<input id="SlopeZYEndMileage1" type="text" class="easyui-validatebox" data-options = "validType:&apos;numberWithZero&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeZYEndMileage2" type="text" class="easyui-validatebox" data-options = "validType:&apos;double&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
html += '</fieldset>';
html += '<fieldset class="struct-info" id="SlopeYZ"><legend>变坡点(YZ)</legend>';
html += '<input type="hidden" id="SlopeYZId" name="SlopeYZId"/>';
if (me.Paras.IsUseCircle != undefined && me.Paras.IsUseCircle == 'True') {
html += '<div class="row"><label for="SlopeYZStartCircle">开始环号:</label><input id="SlopeYZStartCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
html += '<div class="row"><label for="SlopeYZEndCircle">结束环号:</label><input id="SlopeYZEndCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
}
html += '<div class="row"><label for="SlopeYZStartMileage">开始里程:</label>' + me.Paras.prefix +' <input id="SlopeYZStartMileage1" type="text" class="easyui-validatebox" data-options = "validType:&apos;numberWithZero&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeYZStartMileage2" type="text" class="easyui-validatebox" data-options = "validType:&apos;double&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
html += '<div class="row"><label for="SlopeYZEndMileage">结束里程:</label>' + me.Paras.prefix +' <input id="SlopeYZEndMileage1" type="text" class="easyui-validatebox" data-options = "validType:&apos;numberWithZero&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeYZEndMileage2" type="text" class="easyui-validatebox" data-options = "validType:&apos;double&apos;" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
html += '</fieldset>';
$('.content').append(html);

问题描述:通过js添加的输入框,带有easyui-validatebox 验证,但是到前台后,发现验证失效了。

解决办法:在append方法调用后 添加   $.parser.parse($('.content')); 手动激活有效性。

js 生成的html class属性失效问题的更多相关文章

  1. javascript私有属性失效及解决方案

    1.js创建私有属性的方法 在 javascript 中所有对象的成员是公有的 构造函数也是如此: function Gadget ( ) { this.name = ' jack '; this.p ...

  2. js生成有缩进的表格

    项目中用到用了两天时间想到的,记录下来,如有更好的方法,留言给我,谢谢! js做如下表格: json [{"id":302,"serviceId":15,&qu ...

  3. 前端学习-使用JS库Leaflet.js生成世界地图并获取标注地址经纬度。

    介绍:Leaflet是一个开源的JavaScript库,对移动端友好且对地图有很好的交互性. 大小仅仅只有 33 KB, 同时具有大多数地图所需要的特点. Leaflet设计的非常简单易懂, 同时具有 ...

  4. attr设置checked,disabled等属性失效的问题,jquery的attr和prop的区别

    最近做项目遇到一个问题,radio设置了默认checked值,attr("checked",true)切换checked值失效 最后发现是jquery1.6版本之后,attr和pr ...

  5. JS生成指定范围内的随机数(支持随机小数)

    直接需要函数的话,直接到文章的最后面找. ============================================================= 转载:https://www.cn ...

  6. js生成二维码以及点击下载二维码

    js生成二维码 jquery.qrcode.js可以快速使用页面生成二维码.但改项目有两个小问题:1.不支持中文:2.不支持二维码中间生成图片. 支持中文的jquery-qrcode jquery.q ...

  7. Java与JS生成二维码

    1.二维码概念 二维码/二维条码是用某种特定的集合图形按一定规律在平面上(二维方向上)分布的黑白相间的图形记录数据符号信息的图片. 黑线是二进制的1,空白的地方是二进制的0,通过1.0这种数据组合用于 ...

  8. SpringBoot @EnableAutoConfiguration exclude属性失效

    本文链接:https://blog.csdn.net/yuan_ren_sheng/article/details/81516779 在学习SpringBoot的时候,入了不少的坑.今天学习@Spri ...

  9. 利用scrapy-splash爬取JS生成的动态页面

    目前,为了加速页面的加载速度,页面的很多部分都是用JS生成的,而对于用scrapy爬虫来说就是一个很大的问题,因为scrapy没有JS engine,所以爬取的都是静态页面,对于JS生成的动态页面都无 ...

随机推荐

  1. SpringCloud分布式尝试记录

    服务提供端: 客户消费端:

  2. 靶场vulnhub-CH4INRULZ_v1.0.1通关

    1.CH4INRULZ_v1.0.1靶场通关 ch4inrulz是vulnhub下的基于Linux的一个靶场,作为练习之用 目的:通过各种手段,获取到靶机内的flag的内容 2.环境搭建: 攻击机 K ...

  3. ArcGIS使用技巧(五)——批量裁剪

    新手,若有错误还请指正! 最近用到了,所以记下来,用同一矢量范围裁剪多幅栅格数据.用到了ArcGIS中的迭代模型(图1): 图 1 首先,需要做一个准备工作,就是把需要裁剪的栅格数据放在同一数据库中( ...

  4. 使用钡铼BL102网关连接西门子S7-1200PLC 以及mosquitto服务器方法

    一.软硬件描述 西门子PLC S7-1215 钡铼BL102网关 mosquitto MQTT服务器(腾讯云上搭建) 可以上网的路由器一套 二.需要使用的软件. 西门子Portal v15.1 (西门 ...

  5. Ansible Notes: Tower Credential的本质

    Ansible AWX/Tower credential 的本质 Ansible Tower (社区版本叫AWX)用credential这个资源来对象来存储playbook运行过程中用到的机密信息.比 ...

  6. jmeter脚本编写

    jmeter脚本编写 一.http协议接口编写注意事项 1.请求体为json格式:一定要写请求头Content-Type:application/json 2.json格式文本 2.1 key-val ...

  7. 『现学现忘』Git对象 — 15、blob对象介绍

    目录 (一)Git对象的存放目录 (二)Git中对象类型 (三)blob对象 1.blob对象说明 (1)blob对象定义 (2)blob对象说明 (3)blob对象存储的方式 (4)查看blob对象 ...

  8. url路径匹配类

    AntPathMatcher 1.AntPathMatcher类匹配URL规则如下 ?匹配一个字符 * 匹配0个或多个字符 * *匹配0个或多个目录 2.例子 /trip/api/*x    匹配 / ...

  9. Java面试题资料合集

    Java面试题资料合集 2021年最新版--Java+最常见的+200++面试题汇总+答案总结汇总.pdf BIO,NIO,AIO,Netty面试题 35道.pdf Dubbo面试题 47道.pdf ...

  10. 【原创】ShellCode免杀的骚姿势

    ShellCode免杀的骚姿势 常见的免杀手法: shellcode(攻击代码)和加载程序的分离: Lolbins白利用加载shellcode(白名单利用): shellcode混淆.编码解码: sh ...