abh*_*bhi 4 html jquery maskedinput twitter-bootstrap x-editable
我有一个x-editable输入我的bootstrap应用程序,我用来编辑用户名.现在我需要使用jquery.maskedinput.min.js来获取蒙版格式,同时我输入文本框,当我点击跨度时,正如x-editable中那样.这是我的示例html代码
<div id="sZip" class="profile-info-value ">
<span class="editable" id="Dob">dob</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我通过应用这样的j查询获得了x editable
$('#zip').editable({
type: 'text',
name: 'zip',
tpl:' <input type="text" id ="zipiddemo" class="form-control input-sm dd" style="padding-right: 24px;">'
});
Run Code Online (Sandbox Code Playgroud)
它工作正常现在我需要使该文本框可屏蔽,但当我调用这样的蒙版输入函数时
$(".dd").mask("99999-?9999");
Run Code Online (Sandbox Code Playgroud)
它不工作,我不知道确切的原因.任何帮助将不胜感激
Dhi*_*raj 10
它不起作用,因为x可编辑元素是动态添加的.
我希望这有效.
$('#users a').editable({
type: 'text',
name: 'username',
tpl: '<input type="text" id ="zipiddemo" class="mask form-control input-sm dd" style="padding-right: 24px;">'
});
$(document).on("focus", ".mask", function () {
$(this).mask("(999) 999-9999? x99999");
});
Run Code Online (Sandbox Code Playgroud)