This is a migrated thread and some comments may be shown as answers.

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

4 Answers 40 Views
Input
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 01 Jul 2009, 03:34 PM

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>

4 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 03 Jul 2009, 01:30 PM
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.
0
Tsvetoslav
Telerik team
answered on 03 Jul 2009, 01:30 PM
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.
0
Mehmet
Top achievements
Rank 1
answered on 07 Jul 2009, 07:44 AM
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
0
Tsvetoslav
Telerik team
answered on 07 Jul 2009, 02:11 PM
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.
Tags
Input
Asked by
Mehmet
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Mehmet
Top achievements
Rank 1
Share this question
or