Re: Display

On Apr 27, 2010, at 2:55 PM, Anton Prowse <prowse@moonhenge.net> wrote:

> It's just occurred to me what the actual context of your original
> request was!
>
>> It seems the convention to show / hide a validation tag is to  
>> change the inline style from display:none; to display:inline;
>
>>    .form li > label span[style*="inline"] {
>>        display: block !important;
>>        }
>
> You're talking about form validation, in particular the marker which
> indicates whether a form field entry was valid according some  
> criterion,
> right?
>
> The way you described it, it sounds like this marker is present in the
> bare document, and that you're relying on CSS to hide it most of the
> time, and then using JS to unhide it when invalid input has been  
> entered.

I'm guessing it is worse than that; that the span is getting its style  
attribute changed at the server based on validation that takes place  
at the server. I see that sort of thing often in .NET generated forms.  
It would be better to have it generate a class instead (such as  
class='invalid'), and then use a style sheet to add the marker or  
change the color, etc. 

Received on Tuesday, 27 April 2010 22:27:11 UTC