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

[Solved] Restrict user from entering numeric character in ComboBox

1 Answer 131 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dhaval
Top achievements
Rank 2
Dhaval asked on 04 May 2011, 08:35 AM
Hi There,

I am using telerik components for mvc and what i want to do is i want to restrict users from entering numeric values in combobox. Is there any work around with which i can restrict them from entering numeric characters and special characters.

Please reply asap.

Thanking you.

With Regards,
Dhaval

1 Answer, 1 is accepted

Sort by
0
Dhaval
Top achievements
Rank 2
answered on 04 May 2011, 10:12 AM
Hi There,

I have done this using following javascript on keypress event in htmlattribute:
<script type="text/javascript">
 
    function fncInputNumericValuesOnly(e) {
        var event = window.event ? window.event : e;
        var keyCode = window.event ? event.keyCode : (event.charCode || event.which);
        
        if (keyCode >= 65 && keyCode <= 122 || keyCode==8 || keyCode == 0) {
            return true;
        }
        else {
            return false;
        }
    }
 
</script>
Tags
ComboBox
Asked by
Dhaval
Top achievements
Rank 2
Answers by
Dhaval
Top achievements
Rank 2
Share this question
or