473,387 Members | 1,493 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,387 software developers and data experts.

Validator positioning.

My web page is in the FlowLayout Mode. I have 2 validators for a
textbox field: a RequiredFieldValidator and RegularExpressionValidator –
essentially to make sure that the user entered something into the Email
textbox and to make sure that whatever is entered is syntactically a
valid email. How can I force the error to appear in the same place.
The designer will not let me place both validators into the same spot in
Flow Layout mode. As a result, depending on which validator is engaged
the error appears in a different location. The validator code is below.
<asp:RegularExpressionValidator
id="validateEmailRegEx"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Bad email"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
</asp:RegularExpressionValidator>

<asp:RequiredFieldValidator
id="validateEmail"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Enter a valid (no, really) email.">
</asp:RequiredFieldValidator>
Thanks.
Nov 18 '05 #1
3 1633
set the Display property for the validation controls to dynamic...
doing that it would not occupy permanent space in your rendered html would
rather be added and made visible on error

--
Regards,

HD

Once a Geek.... Always a Geek
"Frank Rizzo" <no**@none.com> wrote in message
news:eM*************@TK2MSFTNGP11.phx.gbl...
My web page is in the FlowLayout Mode. I have 2 validators for a
textbox field: a RequiredFieldValidator and RegularExpressionValidator –
essentially to make sure that the user entered something into the Email
textbox and to make sure that whatever is entered is syntactically a
valid email. How can I force the error to appear in the same place.
The designer will not let me place both validators into the same spot in
Flow Layout mode. As a result, depending on which validator is engaged
the error appears in a different location. The validator code is below.
<asp:RegularExpressionValidator
id="validateEmailRegEx"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Bad email"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
</asp:RegularExpressionValidator>

<asp:RequiredFieldValidator
id="validateEmail"
runat="server"
ControlToValidate="txtEmail"
ErrorMessage="Enter a valid (no, really) email.">
</asp:RequiredFieldValidator>
Thanks.

Nov 18 '05 #2
Hermit Dave wrote:
set the Display property for the validation controls to dynamic...
doing that it would not occupy permanent space in your rendered html would
rather be added and made visible on error


You are the man. Simple answer for a simple question.
Nov 18 '05 #3
:) you are welcome

--
Regards,

HD

Once a Geek.... Always a Geek
"Frank Rizzo" <no**@none.com> wrote in message
news:ee**************@TK2MSFTNGP11.phx.gbl...
Hermit Dave wrote:
set the Display property for the validation controls to dynamic...
doing that it would not occupy permanent space in your rendered html would rather be added and made visible on error


You are the man. Simple answer for a simple question.

Nov 18 '05 #4

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

Similar topics

9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
14
by: Harlan Messinger | last post by:
What am I not understanding about the definition of { position: absolute; }? "The box's position (and possibly size) is specified with the 'left', 'right', 'top', and 'bottom' properties. These...
1
by: rufus | last post by:
Hi, I have 2 validators (RegEx and RequiredField) validating a single field. When one of these validators fires I want it to always render in the same position as the other one. The problem is...
22
by: Trevor Orton | last post by:
Hello, I'm having a slight problem using the W3C html validator and I've reviewed the FAQ's with no luck so hopefully someone here would be kind enough to point me in the right direction. I...
1
by: Charles Harrison Caudill | last post by:
with tables there is a clean and algorithmic way to organize things, but with css which is, once you get it working, much cleaner, I have to tweak and patch and hope and pray and curse before...
3
by: Frank Rizzo | last post by:
My web page is in the FlowLayout Mode. I have 2 validators for a textbox field: a RequiredFieldValidator and RegularExpressionValidator – essentially to make sure that the user entered something...
3
by: Angelos Karantzalis | last post by:
Hi guys, I've a small problem with validators. I'm building a single .aspx file that handles all my form posts. I need to be using ASP.NET validators ( or subclasses thereof ), so what i do to...
6
by: tshad | last post by:
I have about 8 validators on my page and I want to show the error message next to or below the field that has the error, but I also want to put 1 message on the top of the page and one on the...
6
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.