I have following HTML structure :
<asp:TextBox ID="txtFrom" class="textBox js-min" runat="server" />
<asp:RequiredFieldValidator ID="strtDtValidator" ControlToValidate="txtFrom" runat="server" ErrorMessage="Please enter a date." Text="*" Display="Dynamic" CssClass="required" EnableClientScript="true"></asp:RequiredFieldValidator>
<span class="label" id=""> End:</span>
<asp:TextBox ID="txtTo" class="textBox" runat="server" />
<asp:RequiredFieldValidator ID="endDtValidator" ControlToValidate="txtTo" runat="server" ErrorMessage="Please enter a date." Text="*" Display="Dynamic" CssClass="required" EnableClientScript="true"></asp:RequiredFieldValidator>
It is displaying star both “*” symbol after the last textbox. How to place them correctly?
if you would like to see the “Please enter a date.” text next to the TextBox then put Text=”Please enter a date.” for the RequiredFieldValidator. TheErrorMessage property is used if you have a ValidationSummary control, which will list all the errors.