Difference between revisions of "CSS GUIDE -MOZ-USER-INPUT"

From CDOT Wiki
Jump to: navigation, search
 
(Notes)
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
'''Media:''' interactive
 
'''Media:''' interactive
  
Possible uses include: .
+
Possible uses include:
 +
*Displaying a textbox that should not even allow the cursor within it--useful to block the content from being copied
 +
*A form that should disable input for a textbox (pre-defined value).
  
 
== Syntax ==
 
== Syntax ==
Line 24: Line 26:
  
 
== Usage Examples ==
 
== Usage Examples ==
 +
This sample code provides a textbox which does not allow input focus (left mouse click and subsequent display of the cursor):
 +
<pre>
 +
<span style="-moz-user-input: disabled;">
 +
<input type="text" name="tb1" value="qwerty" />
 +
</span>
 +
</pre>
  
 
== Notes ==
 
== Notes ==
 
This property is similar to the [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-input user-input] property of CSS3.
 
This property is similar to the [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-input user-input] property of CSS3.
 +
 +
According to the W3C, <i>"any settings for the user-input property are ignored when inside a style declaration selected by either the :enabled or :disabled pseudo-classes. This is to avoid the obvious infinite loop of setting user-input:disabled on a :enabled pseudo-class for example."</i> [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-input]
  
 
== Specification Conformance  ==
 
== Specification Conformance  ==
Line 38: Line 48:
 
== See Also ==
 
== See Also ==
 
[[CSS_GUIDE_-MOZ-USER-FOCUS|-moz-user-focus]]
 
[[CSS_GUIDE_-MOZ-USER-FOCUS|-moz-user-focus]]
<br>[[CSS_GUIDE_-MOZ-USER-INPUT|-moz-user-input]]
+
<br>[[CSS_GUIDE_-MOZ-USER-SELECT|-moz-user-select]]
 
<br>[[CSS_GUIDE_-MOZ-USER-MODIFY|-moz-user-modify]]
 
<br>[[CSS_GUIDE_-MOZ-USER-MODIFY|-moz-user-modify]]
  

Latest revision as of 23:39, 13 December 2006

Summary

-moz-user-input is a Mozilla property extension to CSS that is used to determine whether or not an element may be selected with input focus.

Media: interactive

Possible uses include:

  • Displaying a textbox that should not even allow the cursor within it--useful to block the content from being copied
  • A form that should disable input for a textbox (pre-defined value).

Syntax

TARGET_ELEMENT{-moz-user-input: inherit;}
TARGET_ELEMENT{-moz-user-input: disabled;}
TARGET_ELEMENT{-moz-user-input: enabled;}
TARGET_ELEMENT{-moz-user-input: none;}

Legal Values

ValueDescription
inheritInherit the value from the parent element.
disabledThe element will not accept user input.
enabledThe element accepts user input.
noneThe element does not respond to user input, and as such, neither disabled nor enabled are applicable.

Usage Examples

This sample code provides a textbox which does not allow input focus (left mouse click and subsequent display of the cursor):

<span style="-moz-user-input: disabled;">
 <input type="text" name="tb1" value="qwerty" />
</span>

Notes

This property is similar to the user-input property of CSS3.

According to the W3C, "any settings for the user-input property are ignored when inside a style declaration selected by either the :enabled or :disabled pseudo-classes. This is to avoid the obvious infinite loop of setting user-input:disabled on a :enabled pseudo-class for example." [1]

Specification Conformance

Doesn't conform to CSS standards; A Mozilla CSS Extension.

Browser Compatibility

Netscape 6+
Mozilla 0.6+
Firefox 1.0+

See Also

-moz-user-focus
-moz-user-select
-moz-user-modify

References

Mozilla Developer Centre - CSS Reference - Mozilla Extensions, particularly: [2] (developer.mozilla.org)
Netscape CSS Extensions (blooberry.com)
User Interface for CSS3 (w3.org)