On a webpage i have 3 dropdown controls and few textboxes with a required field validators.
I want to highlight the controls for which the value is not specified. May be set the border color or background color.
How can i achieve this? i want it only on page submit.
Kindly help!
Code sample with two rows having two controls and a submit button
<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" />