In the following css
.garbage {
display: none;
}
.garbage[style*=visible] + input,
.garbage[style*=visible] + select,
.garbage[style*=visible] + textarea {
background-color: #ffcccc;
border: 1px solid #ff0000;
}
the asp:*Validator is before a form. How do I change the css so that the validator can be after the form.
The css (https://stackoverflow.com/a/28886219/6346811) works for the following:
<asp:RequiredFieldValidator ID="blah" runat="server"
ErrorMessage="Please fill out this field" CssClass="garbage"
ControlToValidate="txt_blah" ValidationGroup="blah"
SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:TextBox ID="txt_DateBirth" runat="server"></asp:TextBox>
But it doesn't work for
<asp:TextBox ID="txt_DateBirth" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="blah" runat="server"
ErrorMessage="Please fill out this field" CssClass="garbage"
ControlToValidate="txt_blah" ValidationGroup="blah"
SetFocusOnError="True"></asp:RequiredFieldValidator>