Skip to content Skip to sidebar Skip to footer

Masked Input Plugin Not Working

EDIT: I found the the answer which fixed my issue at this link How to make JQuery masked-input plugin working after AsyncPostback in asp.net Ajax Update pannel? I am using this plu

Solution 1:

Make sure you are loading the CORE jQuery library and UI library:

These libraries must be loaded first: (these are just an example, use whatever version you prefer but you need jQuery loaded)

<scriptsrc="//code.jquery.com/jquery-1.9.1.js"></script><scriptsrc="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

this is not correct:

 $(function () {
    $('<%= txtPhoneNum.ClientID %>').mask("(999) 999-9999");
           });

You need to use and need to prefex the elementId with a #:

$( document ).ready(function() {
    $('#<%= txtPhoneNum.ClientID %>').mask("(999) 999-9999");
});

Make sure you are loading the jquery library NOT JUST THE MASKED plugin I don't see you doing that.

Post a Comment for "Masked Input Plugin Not Working"