Is there a CSS selector for disabled input type=»submit» or «button» ?
Should I just use input[type=»submit»][disabled] ?
Does that work in IE6?
3 Answers 3
No, IE6 does not support attribute selectors at all, cf. CSS Compatibility and Internet Explorer.
EDIT
If you are to ignore IE6, you could do (CSS2.1):
You can substitute [disabled=disabled] (attribute value) with [disabled] (attribute presence).
I know the following works:
But how would you disable this?
Any idea? Do I have to use javascript?
Okay. It might have been my Firefox problem. I swear I did use the same synatx. Thanks, and sorry for such a silly question?
3 Answers 3
You can use disabled=»disabled» on input ‘s that are of type submit :
Note that disabled is a boolean attribute. There are variations in syntax, but they all have the same effect:
In order to dynamically disable a button, you do need to use javascript.
Attach to the click event and set the control to disabled.
If you just want to do so in the HTML, the disabled attribute works just as well:
Блокирует доступ и изменение поля формы. Оно в таком случае отображается серым и недоступным для активации пользователем. Кроме того, такое поле не может получить фокус путем нажатия на клавишу Tab , мышью или другим способом. Тем не менее, такое состояние поля можно менять с помощью скриптов. Заблокированное в поле значение не передаётся на сервер.