0

on ctrl+v to the jqxmasked Input field (330)535-0505, it should remove the non-integers value, but while assigning edited value to Id output varies.. here is the code which I tried

$("#id").jqxMaskedInput({
    height: 20,
    width: 115,
    theme: theme,
    mask: '(###)###-#######'                    
});
$("#id").on("keyup", function () {
    var s = $("#id").val();
    alert(s);//shows ((33)0)5-35-0-505
    var t = s.replace(/[^0-9.]/g, "");        
        
    alert($("#id").val(t)); // but in UI it shows (305)505-55-0505          
});
Rela
  • 1
  • 2
  • Why are you re-declaring and re-assigning `t` when you set the UI value? (Here: `var t = $("#id").val(t);` ) – DBS Sep 16 '21 at 08:57
  • hai @DBS thank u, i have edited it, but however that is not the issue – Rela Sep 16 '21 at 13:10

0 Answers0