Remove literals from input mask after form submit?

后端 未结 7 1060
轮回少年
轮回少年 2020-12-31 03:17

this question has already been asked but the solutions where not clear.

Im using Josh Bush\'s MaskedInput plugin for jQuery

What im trying to achieve is:

7条回答
  •  旧时难觅i
    2020-12-31 03:57

    You can also extract the raw value on a masked input using

    $("#YourSelector").data( $.mask.dataName )();
    

    Source : https://github.com/digitalBush/jquery.maskedinput/issues/318


    Example
    If you use a phone input with such a mask :

    $(".phone").mask("99 99 99 99 99")
    

    you can extract the user input using :

    $(".phone").data($.mask.dataName)() 
    // will produce "0102030405" while the masks displays 01 02 03 04 05
    

提交回复
热议问题