I have used a asp:RequiredFieldValidator to validate a textbox. It works fine. But i need to change the position of the error message.
<div class="form-group">
<label for="txtGarageName" class="col-sm-2 control-label">Garage Name</label>
<asp:TextBox runat="server" placeholder="Garage Name" CssClass="form-control" Width="50%" ID="txtGarageName"></asp:TextBox>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server"
ControlToValidate="txtGarageName"
ErrorMessage="Garage name is a required field."
ForeColor="Red">
</asp:RequiredFieldValidator>
</div>
When i use this error message display starting from directly under the label. What i need to do is get the error message to display either in front of the text box or align it with the TextBox start point which means to alighn it more to right. I have tried using a css code as well as putting
margin-left=""
which i saw as solutions in the internet. Neither worked properly.
class="span6"for textbox and the same for the required field validator - Abhishek Ghoshcol-sm-6AND usedisplay=dynamicin Required Field Validator - Abhishek GhoshErrorMessagecould be simply a*withForeColor=Red- Abhishek Ghosh