【发布时间】:2012-07-16 09:25:59
【问题描述】:
我正在使用 C# 和 MVC3
我有一个 RadioButton,根据选择的选项,我需要更改文本框的掩码。 我正在为 jQuery 使用 Masked Input 插件。
我该怎么做?我必须在Controller或.cshtml上开发它?
<div class="editor-field">
@Html.LabelFor(model => model.Type)
@Html.Label("Test Label")
@Html.RadioButtonFor(model => model.RbTest, "F", true)
@Html.Label("Test Label 2")
@Html.RadioButtonFor(model => model.RbTest, "J")
@Html.LabelFor(model => model.LabelBla)
@Html.EditorFor(model => model.NeedMask)
</div>
如果我选择“F”(第一个单选按钮),我想要一个面具。 如果我选择“J”(第二个单选按钮),我想要另一个面具。
我需要屏蔽编辑器:“NeedMask”
【问题讨论】:
-
你需要一些 JavaScript。
-
是的,我试过了: 但是失败了
标签: c# javascript asp.net-mvc-3 radio-button maskedinput