2

I write in asp.net with c# code and some jscript.

I’m using CompareValidators and RegularExpressions to validate certain fields. This is working fine except for one problem. The exception messages take up room which is distorts the look of the form. I don’t want the message to take any room unless they actually need to be displayed. If I was issuing a post back I could handle it by making it visible and invisible. But in this case I don’t know how to handle it.

Bob Avallone
  • 979
  • 7
  • 20
  • 36

1 Answers1

6

Set the Display property to Dynamic on your validators. This will set the span that contains the error message to display:none when it is not visible which does not take up any room on the page.

Ben Robinson
  • 21,601
  • 5
  • 62
  • 79