I am developing a contactus webpage that has an input field called Email. It is checked using the required validation module and validation of regular expressions with corresponding messages.
Required: enter email address Regular expression: invalid email address
I install these two as follows:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox> <font color="#FF0000">*</font> <asp:RequiredFieldValidator ID="rfvemail" CssClass="error_text" ControlToValidate="txtEmail" runat="server" ErrorMessage="Enter email address."></asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="revemail" runat="server" ControlToValidate="txtEmail" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
My problem is that Enter Email and Invalid Email occupy their own space. For example: if I leave the email address as an empty space and click the "Send" button, "Enter Email" is displayed next to it. If I enter an invalid email address (xxx), enter “Send Email”, but select a space, the message “Invalid Email” will appear after this “Enter Email Address” space before.
Is there any way to remove this space?
Mahesh
source share