在网页上,我有 3 个下拉控件和几个带有必填字段验证器的文本框。
我想突出显示未指定值的控件。可以设置边框颜色或背景颜色。
我怎样才能做到这一点?我只希望它在页面提交上。
请帮忙!
具有两行的代码示例,其中包含两个控件和一个提交按钮
<tr>
<td bgcolor="#ffffff" width="500px">
<asp:Label ID="lblcategory" runat="server" Text="Category of Incident" Width="250px"></asp:Label>
<asp:DropDownList ID="ddlincident" runat="server" Width="200px" ValidationGroup="validatePortal"
CssClass="select">
</asp:DropDownList>
</td>
<td style="vertical-align: top; width: 10px">
<asp:Label ID="Label8" Text="*" ForeColor="Red" runat="server"></asp:Label>
<asp:RequiredFieldValidator ID="rfvddlincident" runat="server" ControlToValidate="ddlincident"
ValidationGroup="validatePortal" Display="None" ForeColor="Red" InitialValue="0"
SetFocusOnError="true"></asp:RequiredFieldValidator>
</td>
<td style="vertical-align: top">
<asp:Label ID="Label2" runat="server" CssClass="instructiontext"></asp:Label>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" width="500px">
<asp:Label ID="lblplace" runat="server" Text="Where Did the Incident Take Place"
Width="250px"> </asp:Label>
<asp:TextBox ID="txtplace" MaxLength="50" runat="server" Width="200px" CssClass="textbox"></asp:TextBox>
</td>
<td style="vertical-align: top; width: 10px">
<asp:Label ID="Label9" Text="*" ForeColor="Red" runat="server" Style="vertical-align: top"></asp:Label>
<asp:RequiredFieldValidator ID="txttxtplace" runat="server" ControlToValidate="txtplace"
ValidationGroup="validatePortal" Display="None" ForeColor="Red" SetFocusOnError="true"></asp:RequiredFieldValidator>
</td>
<td style="vertical-align: top">
<asp:Label ID="Label3" runat="server" CssClass="instructiontext"></asp:Label>
</td>
</tr>
<asp:Button ID="Button2" runat="server" Text="Next" ValidationGroup="validatePortal"
OnClick="next_clicked" CssClass="hoverbuttonblue" UseSubmitBehavior="false" />