متشکرم . ولی مشکل برطرف نشد به این خاطر که میخوام در زمان ورود به این فرمت در بیاد .
من چنین کنترلی دارم
<div class="form-group">
<label class="control-label col-lg-2">وجه کالا</label>
<div class="col-lg-4">
<p>
@Html.CheckBox("orderValueCheckBox", ViewBag.orderValueCheckBox == null ? false : true,
new { onchange = "valuesChanged()" })
از گیرنده مبلغ
<span>
@if (ViewBag.mode == "add")
{
@Html.TextBoxFor(x => x.OrderValue, new
{
placeholder = "هزینه کالا",
@class = "form-control width-40",
onchange = "valuesChanged()"
})
}
و می خوام در زمان ورود عدد در این کنترل به شکل currency باشه .
این کد رو نوشتم
در جاوا اسکریپت ولی درست نشد
/////////////////////////////////////////////////////////
function () {
$("input[type=text].currenciesOnly").live('keydown', currenciesOnly)
.live('OrderValue',function () {
$(this).formatCurrency();
});
}
///////////////////////////////////////////