hi
I use below code to type number in persian language into textbox
$(function () {
$('[id*=Txtvam]').keyup(function (e) {
var ctrlKey = 67, vKey = 86;
if (e.keyCode != ctrlKey && e.keyCode != vKey) {
$('[id*=Txtvam]').val(toPersianNumber($(this).val()));
}
});
});
$(function () {
$('[id*=Txtpar]').keyup(function (e) {
var ctrlKey = 67, vKey = 86;
if (e.keyCode != ctrlKey && e.keyCode != vKey) {
$('[id*=Txtpar]').val(toPersianNumber($(this).val()));
}
});
});
function toPersianNumber(input) {
var inputstring = input;
var persian = ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"]
for (var j = 0; j < persian.length; j++) {
inputstring = inputstring.toString().replace(new RegExp(j, "g"), persian[j]);
}
return inputstring;
}
as you see in below code I put textboxs in updatepanel control:
<asp:UpdatePanel ID="UpdatePanel11" runat="server">
<ContentTemplate>
<div id="TRM21R" runat="server" >
<asp:TextBox ID="Txtpar" runat="server" CssClass="txtPar1"></asp:TextBox>
<asp:TextBox ID="Txtvam" runat="server" CssClass="txtvam1"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
here when I run page and type number into textboxs it worked correctly and typed in persian language but when I select Item from dropdownlist and type number into textboxs it doesn't type in persian language...
what should I do?
Bets regards
neda