Right Arrow key and Single quote key keyCode value is same i

Posted by Community Admin on 05-Aug-2018 08:01

Right Arrow key and Single quote key keyCode value is same in firefox browser.

All Replies

Posted by Community Admin on 17-May-2013 00:00

When i type in radtextbox(AspAjax). and i goto to back and forward in
radtextbox then back is ok but forward(right arrow key) is not work
because singlequote and rightarrow key value are same. and i have handle
single quote key.



i have used javascript function that is for do not allow single quote in textbox.



please help



Example :-



I have type : -   Hello

I have back  to E character  He-llo

then i go to forward right arrow  key then i am not go to right side.



my javascript function is :

<telerik:RadTextBox ID="txtName" runat="server" Width="180" MaxLength="25" OnKeyPress = "TextBox_NotAllowedSingleQuotes">

                                        </telerik:RadTextBox>





<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">

function TextBox_NotAllowedSingleQuotes(sender, eventArgs)

    if (eventArgs.get_keyCharacter() == '\'')

        eventArgs.set_cancel(true);

        return true;

   

return false;



</script>

</telerik:RadCodeBlock>



please help me.

Posted by Community Admin on 22-May-2013 00:00

Hi Heera,

Generally the OnKeyPress event should not fire for the arrow buttons. Using the code you provided I have created a sample web site and tested it under various browsers. I was not able to reproduce the problem described. Please test the attached sample and let us know of the result.

Regards,
Angel Petrov
Telerik

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

This thread is closed