Jump to content

Make A Disble Event!


khadem1386

Recommended Posts

HiI make some input in my form DISABLE by JavaScript.as you know. We have some event in css (:active :focus :hover . . .)now I want change their style form :active style to :disable style .When an object in HTML became disable it's (view style) change to Gray (for example)Is there any code in css like this?input:disable { //(when disable an object)?????background-position: 0 0; border-left:10px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }input:focus { // (when focus an object)background-position: 0 0; border-left:1px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }input:hover { //(when hover mouse over on object)background-position: 0 0; border-left:1px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }thank a lot

Link to comment
Share on other sites

HiI make some input in my form DISABLE by JavaScript.as you know. We have some event in css (:active :focus :hover . . .)now I want change their style form :active style to :disable style .When an object in HTML became disable it's (view style) change to Gray (for example)Is there any code in css like this?input:disable { //(when disable an object)?????background-position: 0 0; border-left:10px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }input:focus { // (when focus an object)background-position: 0 0; border-left:1px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }input:hover { //(when hover mouse over on object)background-position: 0 0; border-left:1px solid #C0C0C0; border-right:1px solid #373737; border-top:1px solid }thank a lot
Disable isn't a pseudo property. But you can either make it read only or disabled. Read more here...
Link to comment
Share on other sites

hi:I know about 'disabled'but when I disable an object it's hue don't change and my users can not SPECIFICATION that these object are disable till they examining it.I disabled some object in my form and now I want use a spacial style for them.when I disable an object it's hue don't change because I use style for Normal , hover, focus event.and now I need 'disable' event Thank again

Link to comment
Share on other sites

:disabled is indeed an existing CSS selector. However, it's in CSS3, and as such, it's not supported in IE. Not even IE8. It's supported in the latest versions of all other major browsers though.The best you can do is define styles for a class, like for example .disabled, and then use JavaScript to change the form element's class to .disabled when the element is disabled.

Link to comment
Share on other sites

There's also element[disabled] - I think that's supported in IE 7+, but I'm even less sure about how it will work with JavaScript.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...