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. linux centos 8.2 安装docker

    1 使用yum -y install docker安装后启动docker提示Failed to start docker.service: Unit docker.service not found. ...

  2. React + TypeScript + Taro前端开发小结

    前言 项目到一段落,先来记录一下,本文以前端新手的角度记录React.TypeScript.Taro相关技术的开发体验以及遇到的问题和解决方法. 之前总说要学React(这篇博客:代码使我头疼之Rea ...

  3. Java第十四周作业

    2.设计2个类,要求如下:(知识点:类的继承 方法的覆 盖) [必做题] 2.1 定义一个汽车类Vehicle, 2.1.1 属性包括:汽车品牌brand(String类型).颜色clr (Strin ...

  4. 前端优化建议:合理利用JavaScript的条件运算符

    在最近的项目中要使用到一个格式化文件大小的算法,于是不假思索写了如下代码: function formatSize(size){ if(size<1024){ return size+" ...

  5. properties、yml配置文件映射对象

    1.properties文件内容映射到类对象(属性),如Resource目录下的1.properties文件已配置前缀为com.imooc.people相关的信息,然后: pom添加依赖:spring ...

  6. Visual Studio 修改NuGet 包缓存路径

    Visual Studio 下载的NuGet包默认会缓存到 C:\Users{Windows用户名}.nuget\packages 下,时间一长就会导致 C盘空间严重不足. 那么怎样去设置,让包缓存文 ...

  7. [AcWing 776] 字符串移位包含问题

    点击查看代码 #include<iostream> #include<algorithm> using namespace std; string a, b; int main ...

  8. 下载并配置pycharm

    1.下载(推荐下载社区版) https://www.jetbrains.com/pycharm/download/#section=windows 2.配置代码编写前注释 得到这种效果: 3.设置字体 ...

  9. linux项目部署(非前后端分离crm)

    参考博客 参考博客2---部署过程 导论:看参考博客1 WSGI是Web服务器网关接口.它是一个规范,描述了Web服务器如何与Web应用程序通信,以及Web应用程序如何链接在一起以处理一个请求,(接收 ...

  10. 图解KMP字符串匹配算法+代码实现

    kmp算法跟之前讲的bm算法思想有一定的相似性.之前提到过,bm算法中有个好后缀的概念,而在kmp中有个好前缀的概念,什么是好前缀,我们先来看下面这个例子. 观察上面这个例子,已经匹配的abcde称为 ...