You can find lots of post for CRM 2011 keypress on the Internet. But those methods cannot work on CRM 2013 and 2015 so you can use this method.
1 2 3 4 5 6 7 8 9 10 11 12 |
var field = document.getElementById("fieldname"); field.onkeydown = function(e){ var charCode = (e.which) ? e.which : e.keyCode; if ((charCode <= 93 && charCode >= 65) || (charCode <= 122 && charCode >= 97)) { var curVal = $('#fieldname_i').val(); var val = e.char.toUpperCase(); $('#fieldname_i').val(curVal+val); return false; } }; |
If you are using different language for CRM. You can customize special character’s char code to if statement. For example :
1 2 |
//Turkish characters : ö,Ö,ğ,Ğ,ü,Ü,ı,İ,ş,Ş,ç,Ç //Turkish characters char code :199,214,220,231,246,250,286,287,304,305,350,351 |