如何让unmask vale显示在文本框中? [英] How to get an unmask vale to display in a textbox?

查看:60
本文介绍了如何让unmask vale显示在文本框中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页表单,我正在屏蔽文本框并取消屏蔽它们。当用户在蒙版文本框中输入值并单击或标签到下一个蒙版文本框时,使用Label在屏蔽文本框旁边显示未屏蔽的值。我试图让它显示在文本框中。为什么这不起作用?它适用于标签,但不适用于文本框。



 <   script     src   =  Jquery Scripts / jquery-1.8.3.min.js   类型  =  text / javascript >  <   /   script  >  
< < span class =code-leadattribute> script src = Jquery Scripts / jquery.maskedinput.js 类型 = text / javascript > < / script >
< script type =' text / javascript' >
$( document )。ready( function (){

$ .mask.definitions [' 〜'] = [+ - ];
$( #TextBox1)。mask(' ?999,999');
$( #TextBoxY)。mask(' ?999,999');

$( #TextBox1)。blur( function (){
$( #lblinfo)。html( + $( this )。mask());
$( #TextBoxY) .blur( function (){
$( #TextBoxinfo2)。html( + $( this )。mask());
})。dblclick( function (){
$ ( this )。unmask();


});
});
});


< / script >

解决方案

(< span class =code-sdkkeyword> document )。ready( function (){


.mask。定义[' 〜'] = [+ - ];


#TextBox1)。mask(' ?999,999' );

I have a web form that I am masking textboxes and unmasking them. When the user enters a value into the masked textbox and clicks or tabs to the next masked textbox the unmasked value is shown next to the masked textbox using a Label. I am trying to get it to display in a textbox. Why is this not working? It works for the label but not for the textbox.

<script src="Jquery Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="Jquery Scripts/jquery.maskedinput.js" type="text/javascript"></script>
    <script type='text/javascript'>
        $(document).ready(function () {

            $.mask.definitions['~'] = "[+-]";
            $("#TextBox1").mask('?999,999');
            $("#TextBoxY").mask('?999,999');

            $("#TextBox1").blur(function () {
                $("#lblinfo").html(" " + $(this).mask());
                $("#TextBoxY").blur(function () {
                    $("#TextBoxinfo2").html(" " + $(this).mask());
                }).dblclick(function () {
                    $(this).unmask();


                });
            });
        });


    </script>

解决方案

(document).ready(function () {


.mask.definitions['~'] = "[+-]";


("#TextBox1").mask('?999,999');


这篇关于如何让unmask vale显示在文本框中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆