Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Page History: Read-Only Fields - Displaying as Disabled - CSS

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: Thu, Jul 21, 2011, 1:51 PM


To style read-only fields to look like they're disabled, use the following CSS.

{copytext|css}
input[readonly] {
    color: graytext;
    background: buttonface;
}

In addition, because the READONLY attribute doesn't apply to SELECT elements, they can be "locked" via some jQuery in their ONCHANGE attribute, as follows.

<select onchange='$(this).val(original-value);'>
    <option . . . />
</select>

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.