Accessing the value of RadMaskedTextBox using javascript or JQuery

2 posts, 0 answers
  1. VIJAY
    VIJAY avatar
    31 posts
    Member since:
    May 2011

    Posted 25 Jul 2012 Link to this post

    We have RadMaskedTextBox control and we are setting the PromptChar and Mask propery of RadMaskedTextBox  as PromptChar="_" and Mask="###-###-####". 
    We are accessing the value of RadMaskedTextBox through the javascript like the following:


    $("#<%= rmtbPhone.ClientID %>_text").val()


    When there is no value in RadMaskedTextBox
    For DLL version: 2011.2.816.40, it is giving value as Empty("")
    For DLL version: 2012.2.724.40, it is giving value as "___-___-____" instead of Empty("") 

    How to get the actual value when using new DLL through Javascript or JQuery?

    Thanks in advance,
    Ajit
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 27 Jul 2012 Link to this post

    Hello,

    <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" SelectionOnFocus="SelectAll"
               Label="IP address: " PromptChar="_" Width="300px" Mask="<0..255>.<0..255>.<0..255>.<0..255>">
           </telerik:RadMaskedTextBox>
    function ClientClicktc() {
                   var RadMaskedTextBox1 = $find("<%= RadMaskedTextBox1.ClientID %>");
                   RadMaskedTextBox1.get_textBoxValue(); //123.123.123.123
                   RadMaskedTextBox1.get_value(); // 123123123213
                   }


    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top