473,388 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Unwanted spaces added by Validators

I have the following on one of my Textboxes:

<asp:RequiredFieldValidator
ControlToValidate="email"
Text="Email Required"
runat="server" />
<asp:RegularExpressionValidator ControlToValidate="email" Text =
"Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
<asp:CustomValidator
ControlToValide="email"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Email already on File"
runat="server" />

I also have Required validators on 2 Textboxes above this one. If I don't
enter anything, all the error messages line up. If I enter something, but
one that in invalidated, I get a "&nbsp;" where the RequiredValidator is.
This happens no matter what order I do it. If the Validator doesn't print a
message, it prints a space.

Is there some way to stop this? It just makes the page look out of line.

Thanks,

Tom
Nov 19 '05 #1
6 1136
"tshad" <ts**********@ftsolutions.com> confessed in news:uF$blU0AFHA.3120
@TK2MSFTNGP12.phx.gbl:
I have the following on one of my Textboxes:

<asp:RequiredFieldValidator
ControlToValidate="email"
Text="Email Required"
runat="server" />
<asp:RegularExpressionValidator ControlToValidate="email" Text =
"Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
<asp:CustomValidator
ControlToValide="email"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Email already on File"
runat="server" />

I also have Required validators on 2 Textboxes above this one. If I don't
enter anything, all the error messages line up. If I enter something, but
one that in invalidated, I get a "&nbsp;" where the RequiredValidator is.
This happens no matter what order I do it. If the Validator doesn't print a message, it prints a space.

Is there some way to stop this? It just makes the page look out of line.

Thanks,

Tom


Have you tried laying out using tables?

--
Nov 19 '05 #2
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:uF$blU0AFHA.3120
@TK2MSFTNGP12.phx.gbl:
I have the following on one of my Textboxes:

<asp:RequiredFieldValidator
ControlToValidate="email"
Text="Email Required"
runat="server" />
<asp:RegularExpressionValidator ControlToValidate="email" Text =
"Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
<asp:CustomValidator
ControlToValide="email"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Email already on File"
runat="server" />

I also have Required validators on 2 Textboxes above this one. If I
don't
enter anything, all the error messages line up. If I enter something,
but
one that in invalidated, I get a "&nbsp;" where the RequiredValidator is.
This happens no matter what order I do it. If the Validator doesn't
print

a
message, it prints a space.

Is there some way to stop this? It just makes the page look out of line.

Thanks,

Tom


Have you tried laying out using tables?


They are in a table.

Here is more of a snippet with 3 of the objects:

************************************************** *************************
<tr>
<td align="right">Email Address: </td>
<td><asp:textbox id="txtEmail" TextMode="SingleLine" Columns="32"
runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text="You must enter an email"
runat="server" />
</td>
</tr>
<tr>
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:CheckBox ID="SaveLogon" Runat=server
/>&nbsp;&nbsp;Remember Me?</td>
</tr>
************************************************** ***********************

Tom
Nov 19 '05 #3
"tshad" <ts**********@ftsolutions.com> confessed in news:ewpVXzIBFHA.2788
@TK2MSFTNGP15.phx.gbl:
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:uF $blU0AFHA.3120 @TK2MSFTNGP12.phx.gbl:
I have the following on one of my Textboxes:

<asp:RequiredFieldValidator
ControlToValidate="email"
Text="Email Required"
runat="server" />
<asp:RegularExpressionValidator ControlToValidate="email" Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
<asp:CustomValidator
ControlToValide="email"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Email already on File"
runat="server" />

I also have Required validators on 2 Textboxes above this one. If I
don't
enter anything, all the error messages line up. If I enter something,
but
one that in invalidated, I get a "&nbsp;" where the RequiredValidator is. This happens no matter what order I do it. If the Validator doesn't
print a
message, it prints a space.

Is there some way to stop this? It just makes the page look out of line.
Thanks,

Tom


Have you tried laying out using tables?


They are in a table.

Here is more of a snippet with 3 of the objects:

************************************************** ***********************

** <tr>
<td align="right">Email Address: </td>
<td><asp:textbox id="txtEmail" TextMode="SingleLine" Columns="32" runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text="You must enter an email"
runat="server" />
</td>
</tr>
<tr>
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:CheckBox ID="SaveLogon" Runat=server
/>&nbsp;&nbsp;Remember Me?</td>
</tr>
************************************************** ***********************

Tom


What I do is use the static display. This way i know how much space they'll
take up. Dynamic display doesn't always work like you think it will.

-- ipgrunt

Nov 19 '05 #4

"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:ewpVXzIBFHA.2788
@TK2MSFTNGP15.phx.gbl:
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:uF $blU0AFHA.3120 @TK2MSFTNGP12.phx.gbl:

I have the following on one of my Textboxes:

<asp:RequiredFieldValidator
ControlToValidate="email"
Text="Email Required"
runat="server" />
<asp:RegularExpressionValidator ControlToValidate="email" Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
<asp:CustomValidator
ControlToValide="email"
OnServerVAlidate="ValidateEmail"
Display="Dynamic"
Text="Email already on File"
runat="server" />

I also have Required validators on 2 Textboxes above this one. If I
don't
enter anything, all the error messages line up. If I enter something,
but
one that in invalidated, I get a "&nbsp;" where the RequiredValidator is. This happens no matter what order I do it. If the Validator doesn't
print
a
message, it prints a space.

Is there some way to stop this? It just makes the page look out of line.
Thanks,

Tom


Have you tried laying out using tables?
They are in a table.

Here is more of a snippet with 3 of the objects:

************************************************** ***********************

**
<tr>
<td align="right">Email Address: </td>
<td><asp:textbox id="txtEmail" TextMode="SingleLine"

Columns="32"
runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text="You must enter an email"
runat="server" />
</td>
</tr>
<tr>
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:CheckBox ID="SaveLogon" Runat=server
/>&nbsp;&nbsp;Remember Me?</td>
</tr>
************************************************** ***********************

Tom


What I do is use the static display. This way i know how much space
they'll
take up. Dynamic display doesn't always work like you think it will.


I tried changing both to static and I still get the same thing.

If I change the order, it works ok, only the &nbsp; is placed after the
message, instead of before. Here is what gets generated:
************************************************** ******
<td><input name="txtEmail" type="text" size="32" id="txtEmail" />
<span><font color="Red" size="2">You must enter an
email</font></span>
&nbsp;
</td>
************************************************** ******************

Tom -- ipgrunt

Nov 19 '05 #5
"tshad" <ts**********@ftsolutions.com> confessed in news:OIfa6fJBFHA.2792
@TK2MSFTNGP15.phx.gbl:

"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:ewpVXzIBFHA.2788 @TK2MSFTNGP15.phx.gbl:
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:uF

$blU0AFHA.3120
@TK2MSFTNGP12.phx.gbl:

> I have the following on one of my Textboxes:
>
> <asp:RequiredFieldValidator
> ControlToValidate="email"
> Text="Email Required"
> runat="server" />
> <asp:RegularExpressionValidator ControlToValidate="email" Text
=
> "Invalid Email Address!"
> ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
> <asp:CustomValidator
> ControlToValide="email"
> OnServerVAlidate="ValidateEmail"
> Display="Dynamic"
> Text="Email already on File"
> runat="server" />
>
> I also have Required validators on 2 Textboxes above this one. If I
> don't
> enter anything, all the error messages line up. If I enter
something,> but
> one that in invalidated, I get a "&nbsp;" where the RequiredValidator

is.
> This happens no matter what order I do it. If the Validator doesn't
> print
a
> message, it prints a space.
>
> Is there some way to stop this? It just makes the page look out of

line.
>
> Thanks,
>
> Tom
>
>
>

Have you tried laying out using tables?

They are in a table.

Here is more of a snippet with 3 of the objects:

************************************************** *********************** **
<tr>
<td align="right">Email Address: </td>
<td><asp:textbox id="txtEmail" TextMode="SingleLine"

Columns="32"
runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text="You must enter an email"
runat="server" />
</td>
</tr>
<tr>
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:CheckBox ID="SaveLogon" Runat=server
/>&nbsp;&nbsp;Remember Me?</td>
</tr>

************************************************** ***********************
Tom


What I do is use the static display. This way i know how much space
they'll
take up. Dynamic display doesn't always work like you think it will.


I tried changing both to static and I still get the same thing.

If I change the order, it works ok, only the &nbsp; is placed after the
message, instead of before. Here is what gets generated:
************************************************** ******
<td><input name="txtEmail" type="text" size="32" id="txtEmail" />
<span><font color="Red" size="2">You must enter an
email</font></span>
&nbsp;
</td>
************************************************** ******************

Tom
-- ipgrunt



Have you considered putting the control and the validator in different
columns?

--
Nov 19 '05 #6
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:OIfa6fJBFHA.2792
@TK2MSFTNGP15.phx.gbl:

"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"tshad" <ts**********@ftsolutions.com> confessed in news:ewpVXzIBFHA.2788 @TK2MSFTNGP15.phx.gbl:

"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
> "tshad" <ts**********@ftsolutions.com> confessed in news:uF
$blU0AFHA.3120
> @TK2MSFTNGP12.phx.gbl:
>
>> I have the following on one of my Textboxes:
>>
>> <asp:RequiredFieldValidator
>> ControlToValidate="email"
>> Text="Email Required"
>> runat="server" />
>> <asp:RegularExpressionValidator ControlToValidate="email" Text =
>> "Invalid Email Address!"
>> ValidationExpression="\S+@\S+\.\S{2,3}" runat="server" />
>> <asp:CustomValidator
>> ControlToValide="email"
>> OnServerVAlidate="ValidateEmail"
>> Display="Dynamic"
>> Text="Email already on File"
>> runat="server" />
>>
>> I also have Required validators on 2 Textboxes above this one. If I
>> don't
>> enter anything, all the error messages line up. If I enter something,>> but
>> one that in invalidated, I get a "&nbsp;" where the RequiredValidator
is.
>> This happens no matter what order I do it. If the Validator doesn't
>> print
> a
>> message, it prints a space.
>>
>> Is there some way to stop this? It just makes the page look out of
line.
>>
>> Thanks,
>>
>> Tom
>>
>>
>>
>
> Have you tried laying out using tables?

They are in a table.

Here is more of a snippet with 3 of the objects:

************************************************** *********************** **
<tr>
<td align="right">Email Address: </td>
<td><asp:textbox id="txtEmail" TextMode="SingleLine"
Columns="32"
runat="server" />
<asp:RegularExpressionValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text = "Invalid Email Address!"
ValidationExpression="\S+@\S+\.\S{2,3}"
runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Font-Size="10"
Text="You must enter an email"
runat="server" />
</td>
</tr>
<tr>
<td align="right">Password</td>
<td><asp:textbox id="txtPassword" TextMode="Password"
Columns="32" runat="server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="You must enter an password"
Font-Size="10"
runat="server" />
<asp:CustomValidator
ControlToValidate="txtEmail"
OnServerValidate="ValidateEmail"
Font-Size="10"
Display="Dynamic"
Text="Not Valid !"
runat="server" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:CheckBox ID="SaveLogon" Runat=server
/>&nbsp;&nbsp;Remember Me?</td>
</tr>
************************************************** ***********************
Tom


What I do is use the static display. This way i know how much space
they'll
take up. Dynamic display doesn't always work like you think it will.

I tried changing both to static and I still get the same thing.

If I change the order, it works ok, only the &nbsp; is placed after the
message, instead of before. Here is what gets generated:
************************************************** ******
<td><input name="txtEmail" type="text" size="32" id="txtEmail" />
<span><font color="Red" size="2">You must enter an
email</font></span>
&nbsp;
</td>
************************************************** ******************

Tom
-- ipgrunt



Have you considered putting the control and the validator in different
columns?

If I do that, the second message will show way over to the right.

Tom --

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ron Brennan | last post by:
Good morning. I want to send split to a String such as " abc def " and receive back an Array with the two elements String(abc) and String(def); and I want to receive back a zero-length...
7
by: ITM | last post by:
Can anyone tell me how I can prevent Access adding trailing spaces when I insert a value into a Text column? For example, if I execute the following statement: UPDATE Log SET Log.Title =...
2
by: Nazir | last post by:
Hi I'm using a regular expression validator, but if spaces are entered, it bypasses the validation! I'm using ^{5,100}$
3
by: Prince | last post by:
I have some <RequiredFieldValidator> on my page and everything works fine except that there are lots of white spaces between the web server controls that are being validated. I've set the Display...
0
by: Chris | last post by:
I might be missing something but why is it that the RangeValidator and comparevalidator validators accept spaces???????? isn't that counter productive? How can I make sure that there are no spaces...
2
by: prabhupr | last post by:
Hi Folks In CS project, we use "using" statement to make reference to other namespaces. For example: using System; using System.Data; using System.Configuration; At times, there a is a...
3
by: Danny Yeadon | last post by:
Hi I need to remove unwanted characters from phone numbers from my phone bill to analyse the data. Some examples are 02 48222222 i need to remove the space +61266667656 ...
8
by: uzuria | last post by:
Hi there. I am doing a school project and need to be able to retrieve data from a file and display it in a selectable list box. I originally used a random access file, because I need to select...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.