- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
对于数据输入字段,我想在用户将鼠标悬停在该字段上时向他们显示提示。字段名称是 INACT,表示记录是否已被停用。需要这样的东西 - 输入 I 以停用记录。
我在模型元数据中有这个
[Display(Name = "INACT")]
[DisplayFormat(ConvertEmptyStringToNull = true)]
[StringLength(1)]
public string A_INACT;
并在非事件 View 中显示 - 此 View 是唯一可以编辑此字段的地方。 :
<div class="editor-label">
@Html.LabelFor(model => model.A_INACT)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.A_INACT , new { htmlAttributes = new { tabindex = 1 } })
@Html.ValidationMessageFor(model =>Model.A_INACT)
</div>
INACT 观点
@model MTSapp.Models.mts_rename
@{
ViewBag.Title = "Inact";
}
<style>
.container {
width: 50%;
float: left;
}
</style>
<h2>RE NAME </h2>
<h2>Inact Re Number</h2>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<fieldset>
<legend>mts_rename</legend>
<br />
<div class="editor-label">
@Html.LabelFor(model => model.A_ID)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.A_ID, new { @class = "form-control", @readonly = "readonly", @style = "background:#f2f3f3", tabindex = 4 })
</div>
<div class="editor-label">
@Html.LabelFor(model => model.A_RENO)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.A_RENO, new { @class = "form-control", @readonly = "readonly", @style = "background:#f2f3f3", tabindex = 5 })
</div>
<div class="editor-label">
@Html.LabelFor(model => model.A_INACT)
</div>
<div class="editor-field">
<span class="SpaceAvailableSearch">@Html.EditorFor(model => model.A_INACT, new { htmlAttributes = new { tabindex = 1, title = "Enter I to Inactivate Record" } }) </span>
@Html.ValidationMessageFor(model => model.A_INACT)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.A_NAME)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.A_NAME, new { @class = "form-control", @readonly = "readonly", @style = "background:#f2f3f3", tabindex = 6, @title = "This is the RE NAME." })
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
这是查看源代码:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Inact - MTS Application</title>
<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<link href="/Content/site.css" rel="stylesheet"/>
<script src="/Scripts/modernizr-2.5.3.js"></script>
<link href="/Content/Myspec" rel="stylesheet" type="text/css" />
<link href="/Content/PagedList.css" rel="stylesheet"/>
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title"><a href="/">MATERIAL TEST SYSTEM</a></p>
</div>
<div class="float-right">
<section id="login">
Hello how are you today, <span class="username">AHTD\mase347</span>!
</section>
<nav>
<ul id="menu">
<li><a href="/">Home</a></li>
<li><a href="/Home/Login">Login</a></li>
<li><a href="/Home/About">About</a></li>
<li><a href="/Home/Contact">Contact</a></li>
</ul>
</nav>
</div>
</div>
</header>
<div id="body">
<section class="content-wrapper main-content clear-fix">
<style>
.container {
width: 50%;
float: left;
}
</style>
<h2>RE NAME </h2>
<h2>Inact Re Number</h2>
<form action="/MTS_RENAME/Inact/1" method="post"> <fieldset>
<legend>mts_rename</legend>
<br />
<div class="editor-label">
<label for="A_ID">ID</label>
</div>
<div class="editor-field">
<input class="form-control" data-val="true" data-val-number="The field ID must be a number." data-val-required="The ID field is required." id="A_ID" name="A_ID" readonly="readonly" style="background:#f2f3f3" tabindex="4" type="text" value="1" />
</div>
<div class="editor-label">
<label for="A_RENO">RE NUMBER</label>
</div>
<div class="editor-field">
<input class="form-control" data-val="true" data-val-length="The field RE NUMBER must be a string with a maximum length of 3." data-val-length-max="3" id="A_RENO" name="A_RENO" readonly="readonly" style="background:#f2f3f3" tabindex="5" type="text" value="1" />
</div>
<div class="editor-label">
<label for="A_INACT">INACT</label>
</div>
<div class="editor-field">
<span class="SpaceAvailableSearch"> <input class="text-box single-line" data-val="true" data-val-length="The field INACT must be a string with a maximum length of 1." data-val-length-max="1" id="A_INACT" name="A_INACT" type="text" value="" /> </span>
<span class="field-validation-valid" data-valmsg-for="A_INACT" data-valmsg-replace="true"></span>
</div>
<div class="editor-label">
<label for="A_NAME">RE NAME</label>
</div>
<div class="editor-field">
<input class="form-control" data-val="true" data-val-length="The field RE NAME must be a string with a maximum length of 39." data-val-length-max="39" data-val-required="The RE NAME field is required." id="A_NAME" name="A_NAME" readonly="readonly" style="background:#f2f3f3" tabindex="6" title="This is the RE NAME." type="text" value="ZZ_TESTXDO THIS ZZXXXX" />
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
</form>
<div>
<a href="/MTS_RENAME">Back to List</a>
</div>
</section>
</div>
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>© 2017 - My ASP.NET MVC Application</p>
</div>
</div>
</footer>
<script src="/Scripts/jquery-1.7.1.js"></script>
<script src="/Scripts/jquery-2.1.4.js"></script>
<script src="/Scripts/jquery-migrate-1.2.1.js"></script>
<script src="/bundles/bootstrap"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
</body>
</html>
最佳答案
HTML 有一个类似这样的工具提示的 title
属性。 (对于比基本工具提示更复杂的任何东西,您将查看一些自定义样式和可能的 JavaScript 功能来模仿工具提示,具体取决于所采用的方法。谷歌为此提供了各种现成的解决方案。)
那么您在哪里设置自定义 HTML 属性:
htmlAttributes = new { tabindex = 1 }
您可以简单地为 title
添加一个:
htmlAttributes = new { tabindex = 1, title = "Enter an I to Inactivate a record" }
关于c# - MVC Razor EditorFor Display Field help 当鼠标悬停在字段 aka 工具提示上时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47203361/
除了 Display.getOrientation() 已弃用之外,Display.getRotation() 和 Display.getOrientation() 之间还有什么区别? 是否都返回等于
我的问题 这些方法中有哪一种是专业网页设计师所偏爱的吗? Web 浏览器在绘制网站时是否首选这些方法中的任何一种? 这只是个人喜好吗? 我还缺少其他技巧吗? 注意:以上问题是关于设计多列布局 floa
我的问题 专业网页设计师是否喜欢这些方法? 网页浏览器在绘制网站时是否首选这些方法? 这只是个人喜好吗? 我还缺少其他技术吗? 注意:以上问题与设计多列布局有关 float :左; http://js
我有一些代码返回 MyTrait 类型的特征对象,这样它就可以返回几个不同结构之一。我想为 trait 对象实现 Display trait,这样我就可以打印对象,并将详细信息委托(delegate)
package polymorphism; /* * @author Rahul Tripathi */ public class OverLoadingTest { /** *
我希望 Display.timerExec(int,Runnable)与 Display.asyncExec(Runnable) 大致相同但有指定的延迟。然而,似乎Display.timerExec只
就像标题所暗示的,有什么区别吗?我当时使用的是pygame.display.flip,我在互联网上看到的是,他们使用pygame.display.update而不是使用flip。哪一个更快? 最佳答案
Sample.this.display() 和 this.display() 哪个更好? class Sample{ void display(){ System.out.println("d
当图像的 CSS 属性“显示”已被任何其他 JS 脚本/函数更改时,我想运行一些 JS 代码。有什么方法可以监视该更改并设置回调函数吗? $(this).bind.('propertychange',
在浏览 Google 字体时我注意到第一个过滤器包含这些类别: Serif Sans 衬线 展示 手写 我知道什么是 (Sans)Serif 和 Handwriting 类别(这很明显)但是显示类别过
我想知道是否可以在列标记内渲染自定义 html,这是显示表标记的一部分。 例如,我希望我的专栏里面有一些下拉列表? 使用纯 html,如下所示: ... Volvo Saab Me
display.newImage() 和 display.newImageRect() 有什么区别? 哪个更好用? 最佳答案 display.newImage() 的文档具体提到: NOTE: dis
我正在使用纯 JS 和 flexbox 为我的元素创建网格。 元素的某些部分在页面加载时被显示隐藏:无,但单击按钮后它应该在不显示和阻止之间切换。 可悲的是,这完全破坏了 display: flex
我目前正在参加 HTML/CSS 类(class),这本书推荐我使用.desktop {display:none;}/.mobile {display:inline;} 以及div class="de
这个问题在这里已经有了答案: Css transition from display none to display block, navigation with subnav [duplicat
我理解 style="display: none" 隐藏一个 HTML 元素,而 style="display: block" 显示一个 block 级 HTML 元素。 我看到一些使用 style=
设置控件的样式 display: none 和 display: block 有什么区别? 最佳答案 display 属性定义了某个 HTML 元素应该如何显示。 Display block 和 no
这个问题已经有答案了: Javascript AND operator within assignment (7 个回答) 已关闭 4 年前。 假设我只想在 this.state.display 为
我不确定如何命名这个问题,因为我是 Rust 新手,所以请随意提出修改建议。 我有两个结构。一个是 Job 结构,其中包含一些数字,例如作业需要多长时间等。另一个是 JobSequence,其中包含
我不确定如何命名这个问题,因为我是 Rust 新手,所以请随意提出修改建议。 我有两个结构。一个是 Job 结构,其中包含一些数字,例如作业需要多长时间等。另一个是 JobSequence,其中包含
我是一名优秀的程序员,十分优秀!