get_carretPosition() always returns 0 in keypressed event on client-side

5 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    3 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post


    Hello everyone,

    I am trying to accept users' credit card number into 4 maskedtextboxes. When user completes every four digit in the box, I shift the focus to the next text box.

    For that reason I tried to check the carret position whenever user presses a key. But unfortunately everytime the carretPosition results with 0.

    Is there any work around or is it natural for carretPosition to be 0 in keypressed event on client side?

    You can find the code below :

     <script type="text/javascript">

                   function goNextCreditCardTextBox(sender, args) {
                
                    if (args._keyCode > 47 && args._keyCode < 58) {
                       alert(  $find(sender._clientID).get_carretPosition());
                    }
                }
       </script>



    <telerik:RadMaskedTextBox ID="creditCardNumberTextBox1" runat="server" Mask="####"  Width="27">
              <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
    </telerik:RadMaskedTextBox>
    <telerik:RadMaskedTextBox ID="creditCardNumberTextBox2" runat="server" Mask="####"  Width="27">
              <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
    </telerik:RadMaskedTextBox>

    <telerik:RadMaskedTextBox ID="creditCardNumberTextBox3" runat="server" Mask="####"  Width="27">
              <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
    </telerik:RadMaskedTextBox>
    <telerik:RadMaskedTextBox ID="creditCardNumberTextBox4" runat="server" Mask="####"  Width="27">
              <ClientEvents OnKeyPress="goNextCreditCardTextBox"  />
    </telerik:RadMaskedTextBox>

  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 03 Jul 2009 Link to this post

    Hello Mehmet,

    This is a know small issue in the MaskedTextBox control. Our development team will do its best to fix it for one of the next internal builds of the controls.

    Excuse us for the inconvenience this might have caused you.

    Best Regards,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 03 Jul 2009 Link to this post

    Hello Mehmet,

    This is a know small issue in the MaskedTextBox control. Our development team will do its best to fix it for one of the next internal builds of the controls.

    Excuse us for the inconvenience this might have caused you.

    Best Regards,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Mehmet
    Mehmet avatar
    3 posts
    Member since:
    Jun 2009

    Posted 07 Jul 2009 Link to this post

    I understand that this is a know issue, but isnt there any work around at least to save my application? In a few weeks we are planning to publish the site and I do not want to make any trouble to my customers?

    King Regards,

    Mehmet
  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 07 Jul 2009 Link to this post

    Hello Mehmet,

    The fix  is already available in the latest internal build dlls that you can download from your customer account.

    I hope this information helps.

    All the best,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017