如何在mvc4剃须刀中应用onfocus [英] how to apply onfocus in mvc4 razor

查看:68
本文介绍了如何在mvc4剃须刀中应用onfocus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的Webgrid我想申请专注于webgrid中的文本框....如何做到这一点.... ???







@if(@Model!= null)

{

@ grdTaxType.GetHtml(

tableStyle:webgrid webgridwidth,

headerStyle:webgridheader,

alternatingRowStyle:webgridaltrowstyle,

selectedRowStyle:select,

rowStyle:webgridrowstyle,

footerStyle:webgridfooter,

列:grdTaxType.Columns(< br $>




grdTaxType.Column(标题:从日期,格式:( item)=> Html.TextBox(txtFromdate, null,new {ID =txtFromdate})),



grdTaxType.Column(head呃:到日期,格式:( item)=> Html.TextBox(txttodate,null,new {ID =txtFromdate})),


grdTaxType.Column(标题:百分比,格式:( item)=> Html.TextBox(percentage,null,new {ID =txtFromdate})),



grdTaxType.Column(标题:删除,格式:@< text> < img



src =../../ Image /delete.GIFalt =style =border:none;/>




))

}















和焦点我想申请





函数Apply_Maskdate(obj){

var Apply_Maskdate =#+ obj.id;

$(txtFromdate).mask(99/99/9999);

}





提前预付....

解决方案

(txtFromdate).mask( 99/99/9999);

}





提前预付....

This is my Webgrid i want to apply on focus on textbox which is in webgrid....how to do that....???



@if (@Model != null)
{
@grdTaxType.GetHtml(
tableStyle: "webgrid webgridwidth",
headerStyle: "webgridheader",
alternatingRowStyle: "webgridaltrowstyle",
selectedRowStyle: "select",
rowStyle: "webgridrowstyle",
footerStyle: "webgridfooter",
columns: grdTaxType.Columns(


grdTaxType.Column(header: "From Date",format: (item) => Html.TextBox("txtFromdate", null, new { ID = "txtFromdate" })),

grdTaxType.Column(header: "To Date", format: (item) => Html.TextBox("txttodate", null, new { ID = "txtFromdate" })),

grdTaxType.Column(header: "Percentage", format: (item) => Html.TextBox("percentage", null,new { ID = "txtFromdate" })),

grdTaxType.Column(header: "Delete", format: @<text><img

src="../../Image/delete.GIF" alt="" style="border: none;" />
)

))
}








and on focus i want to apply


function Apply_Maskdate(obj) {
var Apply_Maskdate = "#" + obj.id;
$(txtFromdate).mask("99/99/9999");
}


thanx in advance....

解决方案

(txtFromdate).mask("99/99/9999");
}


thanx in advance....


这篇关于如何在mvc4剃须刀中应用onfocus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆