[英]Using RegularExpressionValidator to display asterisk on the next label
我有一個要求,我很難解決問題…完成“名稱”字段后,其下方的5個標簽應顯示一個紅色星號
我添加了一個RegularExpressionValidator,一旦填充並標記了文本框,它就會在名稱標簽旁邊動態顯示一個紅色星號,但這不是必需的。
RegularExpressionValidator
<asp:RegularExpressionValidator runat="server" ControlToValidate="txtNewDos" Display="Dynamic" CssClass=" mandatory" ValidationExpression="^([\S\s]{0,1})$"></asp:RegularExpressionValidator>
均價
<asp:Label runat="server" ID="lblNumCurStudentsDos" Text="Number of Current PGR students supervised"></asp:Label>
的CSS
.mandatory:after { content:' *'; color:red }
在“名稱”文本框填充后,有人可以向我指出正確的方向,指示如何在5個標簽旁邊填充我的CSS類嗎?
將RegularExpressionValidator放置在每個標簽<td> </td>
可以
<asp:RegularExpressionValidator runat="server" ControlToValidate="txtNewDos"
Display="Dynamic" CssClass=" mandatory" ValidationExpression="^([\S\s]{0,1})$">
</asp:RegularExpressionValidator>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.