Dynamic Validation not doing what (I think) it should

L

Luis Ferrao

Hi,

To understand the problem, a small description of the situation should
be provided:

I have a Field Control that is made of a one row table with three
columns. The table width is 100%, the first column is 40% and the other
two have a width of 30%. The middle cell has a TextField with 100% width
followed by a requiredValidator (display set to dynamic).

When i submit a empty value, the validation increases my table height to
fit the error message, which is expected.

The weird thing now is that it also increases my table width! One could
think that the error message doesn't fit it horizontally without the
width increase, but unfortunatly it's not that simple since it does the
same thing no matter the size of the error message, even with a single
word error message.

I can't seem to find any explanation for this phenomenon or a way to
avoid it.

Luis
 
P

Peter Blum

Focus on the HTML generated. After all, everything ends up creating HTML or
using Javascript to programmatically modify HTML. In the case of a validator
with Display=Dynamic, you need to know the following:
1. A validator is enclosed in a <span> tag with the error message appearing
as the innerHTML: <span>error message</span>.
2. Display=Dynamic uses the style attribute's display and visibility
properties. style="visibility:hidden;display:none" ->
style="visibility:inherit;display:inline". So understand those style
properties.
3. Whatever tags enclose your validator have their own rules. For example,
when a dynamic validator is inside <p> and </p> tags on its own line, when
shown <p> tags suddenly use more vertical space.

I hope this helps.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top