gdoron
gdoron

Reputation: 150253

CSS of 'error' and readonly textbox

I'm looking for a good CSS for

  1. Marking invalid-error textbox of class "invalidClass".
  2. Marking an input of class ="readonlyClass" as readonly, so it will look pretty much the same in all browsers (not the default of the browsers).

Is there a good website that gives sample CSS for those kinds of issues?

Upvotes: 1

Views: 226

Answers (1)

mikus
mikus

Reputation: 3215

There is a bunch of free css templates sites on the internet. But I would not expect any sophisticated workarounds from them. However, it is nice to begin and steal some 'frameworks'...

Unfortunately, there is no possible way to mark a field as readonly using CSS only. You can achieve that using either js or server-site srcipt through 'readonly' attribute.

However, to make it consistent with the rest of UI and independent from the browser you could additionally specify your style just by setting its background and border to grey and mouse cursor to normal (still don't forget to mark it with readonly).

for the incorrect fields, light red background works usually well for me.

EDIT: Remember, that marking any input field as readonly does not secure it from being modified by an evil user ;-)

Upvotes: 3

Related Questions